11-21-2013 11:25 AM
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!
Jimmy
11-21-2013 11:38 AM - edited 11-21-2013 11:49 AM
That's a snipette. just drag it to your desktop then drag it to the an empty block diagram. Poof!
http://screencast.com/t/unM6ObWPziY1
11-21-2013 12:11 PM
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.
11-21-2013 12:18 PM
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)
11-21-2013 12:56 PM - edited 11-21-2013 01:01 PM
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.
11-21-2013 03:04 PM
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.
11-21-2013 03:16 PM
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.
11-21-2013 03:39 PM
Toss a "trim whitespace" on that Read Data
(it ends with a \n\r)
12-06-2013 12:20 PM
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!
12-06-2013 12:56 PM
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.