LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

visa I/O error -1073807298

Louis,

that will be impossible.... You can't read the whole message if you don't know how long the message is, so you will have to parse the header!
Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 11 of 13
(789 Views)
Hi Louis,
just to summarize:
- you get messages whose length vary from a handful of bytes to hundreds at a low serial speed
- you don't have a termination character
- you don't know in advance the message length (this is not completely clear, I'm guessing from your description)
- you want to read them asap
I recommend you to take some time to decode the message header and get the message length.
Your idea about reading until no more bytes available (I would add: after waiting some tens of ms) is not bad, but it must be tested thoroughly, because it may fail sometimes.
To be honest, also reading the message header is not completely error free, unless the header itself contains some error-checking information; the golden rule here is: never wait forever some event, always make sure a timeout is setup.
Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 12 of 13
(789 Views)
Yes, pinkpanther, that's pretty much correct. to make things worse, the header can have several forms:
  • it can be just one byte with length info
  • it can be 3 bytes, with length info and addresses
  • it can be 2 bytes with length info
  • it can be 4 bytes with length info and sddresses
pretty complicated, I'd say. and I have a converter that loopbacks my message, and that is also a pain... Smiley Very Happy

testing thoroughly any method I implement is not a problem and is preferred to parsing the message at this level. I just hope it works, otherwise... I don't know what other options I have.

TonP, I know it seems like it is impossible, but I stil have a couple of days on my hands and I want to try any idea I can think of before resolving to parse the message in the receive sequence.



Message Edited by louis_nichols on 11-24-2006 06:01 AM

0 Kudos
Message 13 of 13
(781 Views)