03-15-2013 02:17 PM
The balance is set to autoprint. But I still get an error at the Scan for String stage. I am attaching a screenshot.
Thanks, avi0111
03-15-2013 02:22 PM
What is the data you are getting from the VISA read?
03-15-2013 02:24 PM
The read buffer does not show anything. So I'm unsure of whether data is getting to read in the first place.
03-15-2013 02:26 PM
If you change the view setting of the buffer indicator to Hex display (right-click it to find the setting), does anything show up? You might also want to put an indicator on the Return Count of the VISA read to see how many characters are actually returned.
03-15-2013 02:38 PM
Hi Crossrulz,
Nothing on the buffer when switched to Hex display and nothing on the return count indicator.
03-15-2013 02:42 PM
I found this little detail, Communication mode setting of weigh scale has two options: PRINTER (GLP-printout) current setting
SBI (ASCII)
Would this be the problem?
Regards,
avi0111
03-17-2013 10:07 PM
Hi avi0111,
Did you get the communication issue sorted out? It sounded to me like you are on the right track and now just have to get the settings correct on the scale. It would be worth trying the SBI (ASCII) setting instead of the PRINTER (GLP-printout) setting as well. Let me know if you are still having trouble communicating with the scale!
03-18-2013 04:39 PM - edited 03-18-2013 04:45 PM
Hi Bluesknight,
I still cannot fathom whats wrong with scan from string. The communication protocol is set to the settings on the scale (found out settings from display, so cannot be wrong). Automatic printing is enabled. I have tried SBI over GLP-printout. Different Flow Control settings because the Handshake setting on the scale says Hardware, so tried RTS and DTR and still the same problem. I tried to add a format specifier for the Scan from String command and that did not do anything. Does anyone have any suggestions?
PS: Screenshot of VI with changes.
Regards,
avi0111
03-18-2013 05:43 PM
@avi0111 wrote:
Hi Bluesknight,
I still cannot fathom whats wrong with scan from string. The communication protocol is set to the settings on the scale (found out settings from display, so cannot be wrong). Automatic printing is enabled. I have tried SBI over GLP-printout. Different Flow Control settings because the Handshake setting on the scale says Hardware, so tried RTS and DTR and still the same problem. I tried to add a format specifier for the Scan from String command and that did not do anything. Does anyone have any suggestions?
PS: Screenshot of VI with changes.
Regards,
avi0111
The read is only going to read as many bytes are at the port - which will most likely NOT be the complete string you are expecting - therefore, scan from string isn't going to be able to properly parse the partial read it was given. Then it loops around and the reads another small chunk, etc, etc. You have to contain your read within another loop inside your current loop, then get output the complete data to your scan from string.
There's a lot more to be done, also. You have to figure out how you are going to find the start and end of your data - tough when it is streaming. I recommend changing to manual print, send it a print command and read the response. It's much cleaner.
03-19-2013 03:55 PM - edited 03-19-2013 04:11 PM
I have been working on Parsing and this is what I came up with. I use a match pattern for the data from the VISA read and set Regular Expression to +. I am not sure of the offsets but think this will work as the string following the Regular expression is fed into scan from string. I have reworked the format specifier for Scan from string to reflect these changes. Please advise if I am going the right way.
Also, How do I wire the condition for the inner while loop to stop and pass data to Scan from string?
Regards,
avi0111