Showing results for 
Search instead for 
Did you mean: 

VISA Communication - Losing data from string

Thanks a lot! I want to try this but am not sure what all those icons are, is it possible to send as a VI? or is there a way to identify all of those operations and icons?


Thanks again!



0 Kudos
Message 21 of 36

That's a snipette.  just drag it to your desktop then drag it to the an empty block diagram.  Poof!

"Should be" isn't "Is" -Jay
Message 22 of 36

Nice job Jeff.


Another example of a poorly written manual.


"The checksum is appended to responses as an ASCII representation of a two digit hex number representing a mod256 negated sum of all characters in the response up to and including the comma just prior to the checksum itself."


I would interpret that as the response being the entire returned string, which would include the AZ.  (and then leaving off the last two characters that are the checksum since it explicitly excluded them.)  Nothing is obvious in that response that the AZ at the beginning should be excluded as well.


It doesn't even make sense that they would drop off just the AZ at the beginning and not also drop off the comma right after that.

0 Kudos
Message 23 of 36

some silly C coding weenie.  "AZ" used as STX, read til port buffer empty, cast to long, Add add to next val =0? at end, OK no err. 


(Really you still see some embeded junk like that)

"Should be" isn't "Is" -Jay
Message 24 of 36

Another implementation.  Typecast the value to an I8 so that it can be negated.



I think their description of "negated" mod256 is kind of confusing.  You really can't negate an unsigned 8-bit integer, when you are actually doing the 2's complement.  (LabVIEW won't wire the negate function to a U8 wire.)


Trying to google negated mod256 came up with hits, but none were particularly clear.  Many hits just ignored the negated part and only talked about the mod256.  Googling mod256, and googling 2's complement gave hits that were much easier to figure out what operations they were doing.

Message 25 of 36

Thanks Jeff, I tried implementing that code, but I either did not do it correctly, or am mistaking what is actually happening. I do not get the checksums to agree....I have appended my code and attached a screenshot of my results. Thanks for all your continued help everyone.

Download All
0 Kudos
Message 26 of 36

I am not sure, but am I correct in thinking "Sent" field is what the checksum should be in hex, and that it should match the last two characters in my return string? If so, it always returns FF regardless.

0 Kudos
Message 27 of 36

Toss a "trim whitespace" on that Read Data

(it ends with a \n\r)

Kudos for how I could guess that right.........


"Should be" isn't "Is" -Jay
0 Kudos
Message 28 of 36

I'm having troubles now just running my program...I am not sure why...I now receive this error:


Possible reason(s):

VISA: (Hex 0xBFFF003E) Could not perform operation because of I/O error.


I have attached my code....Thanksfor any help!

0 Kudos
Message 29 of 36

Probably a problem with your serial port.


Make sure it still exists in Windows Device Manager.


Then check if it exists in Measurement and Automation Explorer.


Make sure nothing else is trying to use the port at the same time.

0 Kudos
Message 30 of 36