06-16-2017 12:10 PM
Hello everyone,
I want to have my bioreactor system automatized with labview. The problem is that I have an Ohaus scale (R41ME30) connected through a RS232 port but I can't get the weight data or tare it. I can do these things using the software real term so I don't think it is a connection problem, just that I bad labview programmer! There must be something wrong in my code. Could anyone help me with this? I have attached my code and the scale manual. Note that the main code (Rumen reactor control 2) has an initialize subVI to start tp communicate with devices and a Measurement subVI where I wrote the code to read the values in the scale. The pump subVi has the commands to tare the scale.
Thank you very much
Solved! Go to Solution.
06-16-2017 12:54 PM
Can you connect to the Ohaus Scale this via Hyperterminal or some other program similar to that? I use them here at my work and I've found that "P" stands for the print command via RS-232 and should request the weight from the scale. What model of scale are you using?
06-16-2017 01:31 PM
@Eric1977 wrote:
Can you connect to the Ohaus Scale this via Hyperterminal or some other program similar to that? I use them here at my work and I've found that "P" stands for the print command via RS-232 and should request the weight from the scale. What model of scale are you using?
All of the questions you asked are answered in the post above.
06-16-2017 01:42 PM
Why do you have the Byte Count set to "1" at every VISA Read? That means you're only reading 1 character, and I'm fairly certain the output you want is more than one character long.
You should configure the termination character settings to match on both the balance an in LabVIEW, then you can tell it to read some large number of bytes and it will read until it encounters a termination character.
06-16-2017 01:59 PM
I can't open your code to see how you do it. However you might want to look at the Find Instrument Driver utility in the Tools menu. Search for Ohaus. In my version of Labview, I don't see your scale model listed in any of the supported devices list but I don't think it would hurt to download one of them to try. After all, the drivers are going to use basic Serial commands just as you would do. SubVI's are already created for the Connection, Get Weight, Zero commands. You may need to modify the actual command that is sent if it is different than your specific model. This is not an ideal solution but it's a good start.
I would recommend putting a Close port command at the beginning on your code just to make sure the port is closed before trying to connect to it, especially if you are using an outside terminal software for testing. But also in the event that your code doesn't shut down properly, that port will likely be left open and you might not be able to connect.
06-19-2017 09:33 AM
You may want to try working off of and comparing your code to the working code in this forum post.
Although it's not the same device (a Ranger 7000 instead of a 4000), it is in the Ranger series, so it most likely has very similar communication.
R Dahlman
06-27-2017 03:14 PM
Hello all,
Thank you very much for your help. I managed to solve the problem. I basically needed to increase the number of bites that are read in the VISA read and refresh the buffer every time by having a VISA Flush I/O buffer before the VISA write. I also had the subVI inside a time loop with a dt of 100 ms. I had to increase it to 1000 ms
06-27-2017 04:50 PM
Glad that you have it working. Those scales should return a termination charaecter that you don't have to guess at the number of bytes. I didn't see a Configure VISA Port VI so I am assuming that you already know this and I didn't see this in your VI.
06-27-2017 05:11 PM
Yes. This VISA I have it in another subVI. I have attached it.