LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem running two parallel while loops

Solved!
Go to solution

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

 

Download All
0 Kudos
Message 11 of 95
(832 Views)

What is the data you are getting from the VISA read?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 12 of 95
(828 Views)

The read buffer does not show anything. So I'm unsure of whether data is getting to read in the first place.

 

 

0 Kudos
Message 13 of 95
(825 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 14 of 95
(822 Views)

Hi Crossrulz,

    Nothing on the buffer when switched to Hex display and nothing on the return count indicator.

 

0 Kudos
Message 15 of 95
(815 Views)

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

 

0 Kudos
Message 16 of 95
(811 Views)

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!

| Zach J. | Systems Engineer, HIL and Test Cells | National Instruments |
0 Kudos
Message 17 of 95
(761 Views)

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

 

0 Kudos
Message 18 of 95
(742 Views)

@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.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 19 of 95
(720 Views)

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

 

0 Kudos
Message 20 of 95
(663 Views)