The length of the data blocks seems to vary - for example there are several starting 128, 84 with differing lengths..
Iain, kindly gave a link earlier - it looks like it is not as simple as waiting for 128 then reading a fixed number of bytes..
Search found 883 matches
- Tue Mar 19, 2024 2:13 pm
- Forum: General
- Topic: Protocol j1587
- Replies: 80
- Views: 7250
- Tue Mar 19, 2024 7:58 am
- Forum: General
- Topic: Protocol j1587
- Replies: 80
- Views: 7250
Re: Protocol j1587
I think the checksum calculation is incorrect. If this fails then the display won't update. Need to sum all the bytes of the message (including the checksum byte) - it would be easier to use a loop here! - then take the 2s complement MOD 256 Final value compare to checksum byte... Don't have access ...
- Sat Mar 16, 2024 10:29 am
- Forum: General
- Topic: AT Command's
- Replies: 2
- Views: 139
Re: AT Command's
You need to use the escape character '\'
So your string will be .str = "AT+CUSD=1,\"100#\",15"
Martin
So your string will be .str = "AT+CUSD=1,\"100#\",15"
Martin
- Fri Mar 15, 2024 10:01 am
- Forum: Feature Requests
- Topic: Ternary operator in calculation block?
- Replies: 7
- Views: 427
Re: Ternary operator in calculation block?
Autocorrect on my phone..
I read it as not(!) equal - nice that either works...
I read it as not(!) equal - nice that either works...
- Fri Mar 15, 2024 9:21 am
- Forum: Feature Requests
- Topic: Ternary operator in calculation block?
- Replies: 7
- Views: 427
Re: Ternary operator in calculation block?
True - but I've not had any issues so far. Also use if(.x) rather than if(.x !=0 ) - would be interesting to know if it actually saves any memory / or time. Must do a test...
It could come back to bite me someday
Martin
It could come back to bite me someday
Martin
- Fri Mar 15, 2024 6:18 am
- Forum: Feature Requests
- Topic: Ternary operator in calculation block?
- Replies: 7
- Views: 427
Re: Ternary operator in calculation block?
One trick I use a lot - allows an imitation of the ternary operator in a lot of cases.
Boolean operations return 1 for true and 0 for false.
So use:
.v1 = (.v2 < 20) + 2. // 3 if v2 is < 20 else 2
.flag = (.v == 10) // flag true if v = 10
Martin
Boolean operations return 1 for true and 0 for false.
So use:
.v1 = (.v2 < 20) + 2. // 3 if v2 is < 20 else 2
.flag = (.v == 10) // flag true if v = 10
Martin
- Thu Mar 14, 2024 3:43 pm
- Forum: General
- Topic: Protocol j1587
- Replies: 80
- Views: 7250
Re: Protocol j1587
Is that 'in tractor' or only on the bench?
If it's in situ - how long are the leads to the Nextion display? Interfence might be affecting that?
If it's in situ - how long are the leads to the Nextion display? Interfence might be affecting that?
- Thu Mar 14, 2024 8:03 am
- Forum: General
- Topic: Protocol j1587
- Replies: 80
- Views: 7250
Re: Protocol j1587
Odd, how about waiting until the value changes from 128 - it sounds as though only the start byte is being received correctly. Can you just display (or send to uart) all the data received?
- Wed Mar 13, 2024 5:08 pm
- Forum: General
- Topic: Protocol j1587
- Replies: 80
- Views: 7250
Re: Protocol j1587
I tried this - I've used a timer interrupt to add data if running as a simulation.
- Wed Mar 13, 2024 4:24 pm
- Forum: General
- Topic: Protocol j1587
- Replies: 80
- Views: 7250
Re: Protocol j1587
I think the issue is - your code continually searches for 128 - and as soon as it is found - attempts to read 4 bytes from 'after' the 128.
These may not have been received yet...
So - one solution is wait for 128 to be found then wait until caunt_rx >= 4 and then display the values.
Martin
These may not have been received yet...
So - one solution is wait for 128 to be found then wait until caunt_rx >= 4 and then display the values.
Martin