10-08-2012 09:57 AM
New to LabVIEW and have my first task. I have connected to a Setra pressure transducer via rs232 in Com port 4. I'm trying to track and log pressure over a given period of time. A command of "P" must be sent to the transducer for it to return a pressure reading. By searching, so far I have VISA open, close, read and write on my block diagram. I tried to create a constant from the VISA read resource name and connect it to COM4, but that did not work. Not sure how to accomplish my goal or how to wire everything up correctly. Any help for a beginner is appreciated.
10-08-2012 10:06 AM
Use the example finder (Help->Find Examples...) and search for something along the lines of "simple serial communication". There is a good example in there.
10-08-2012 10:28 AM
I get Error -1073807246 at the VISA configure serial port. It tells me the resource is valid, but the VISA cannot currently access it. Is this because I have not sent a "P" command to the device?
10-08-2012 10:35 AM
10-08-2012 10:45 AM
That error is due to some process already having exclusive rights to the port. Do you have Hyperterminal or something else the could be using the COM port open? Did you not close out the VISA reference during previous runs?
10-08-2012 01:05 PM
You were correct! I had forgotten to close digiquartz, which I used to test my connection. Now I can communicate with the transducer, just trying to get it to give me a pressure reading. I'll be back!
10-08-2012 01:20 PM
NI Trace I/O is super useful for seeing when the port is opened and used, etc... Should be installed with your labview already. Might be called NI Spy if you haven't updated in a while.
10-08-2012 01:41 PM - edited 10-08-2012 01:53 PM
So, I can write command "P" and it produces a pressure. Great! Thanks for the help guys. Now I need to get it to monitor pressure and take a reading every x minutes (probably every minute) and graph/log the data. Is this best accomplished by using a loop and a datalogger with maybe a waveform graph?
I have converted the string ( +94.506 PSI A OK) to a number using the "fract/exp string to number" function. So now I have the format I need, I just need it every (insert time period).
10-08-2012 01:49 PM
Yup, just send your P command every minute in a while loop. Make sure only the read and write are in the loop though, setup functions are outside the loop.
10-08-2012 01:52 PM
Just to clearify, the Initializing and Closing of the port should be done outside of the loop. You can write and read inside of the loop as much as you want.