Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Continuously reading pressure values

I recently posted on here about a pressure regulator that we were having trouble interfacing.  We have recently got this to communicate through LabVIEW, using the 'Basic Serial Write and Read.vi".  We can send a digital pressure setpoint to turn the pressure on from 0 to 100% of its input pressure.  Now, we would like to make this look nice in LabVIEW, but do not have much experience with LabVIEW.

What would be the best way to go about charting these pressure values continuously, while simultaneously setting the pressure (or at least do it quick enuogh serially without causing a problem).  I was thinking take the stacked structure used with the write and read VISA sessions, and replacing this with a while loop with a stop button.  I experimented with this, but have not obtained the results I expected, mainly because of my lack of knowledge of LabVIEW.  Does anyone have any suggestions?

Attached is the pdf file that contains the list of commands.  My original idea was to continuously write the 'read local pressure' (pg. 14 of the pdf manual) command using a while loop.  The write string follows the following format: rRM3\r - rRM3 being the command, and \r being the carriage return. 

Any suggestions would be helpful.  Thanks.

Ray
0 Kudos
Message 1 of 5
(3,918 Views)
You say you got it working,
Can you post those vi's and a frontpanel that you like (code not needed)
sombody will try to combine those.

greetings from the Netherlands
0 Kudos
Message 2 of 5
(3,905 Views)

Hi delvec28,

So the hardware is working fine in LabVIEW, but you are just needing help improving the user interface?  Is this correct or are you having trouble with the serial side of the application?

Chris R.
Applications Engineer
National Instruments
0 Kudos
Message 3 of 5
(3,887 Views)
Yes, that is correct.  We have successfully sent two commands using the attached VI (which is the serial write and read vi found in LabVIEW's examples).
The first was 'r050.0\r', which is the send digital setpoint (p.14 of the serial users manual).  The previous command simply sets the output pressure to 50% of the provided input pressure.  We also have sent the command 'rRM3\r', which reads the local pressure. 

I would assume these two commands are all you would need to make a waveform chart, but im not sure how to arrange the VI to allow pressure measurements to be read continuously for graphing.  My logical idea was to put a while loop with a stop button around the VISA write block, to send the command to read the local pressure at every iteration of the loop, where the time between iterations is controlled by a wait or delay block. 

I did mess around with this a little, but could not get it to work, mainly because I wasn't sure how to include both of the write strings, rxxx.x (any number from 000.0 to 100.0) and rRM3.  I figured the first one will be input by the user, and the other could be a string constant.  But then would you need two VISA write blocks, or can you somehow combine the two strings and connect it to the one input termnial of the VISA write block?  Because I don't know much about LabVIEW, I was hoping some of you more experienced programmers could give me some suggestions.

To give you an overview of what we want to do, right now our main focus is to be able to chart the pressure values against time, and then ultimately write a VI, so that all we have to do is hit a start button in LabVIEW, and the pressure regulation will be controlled completely by some other variable and NOT by user input.  For example, in our case we would like to regulate pressure based on the temperature of the two metal blocks which are being used for an imprinting process.  For a sample run, we would hit the start button: We would most likely want the pressure to be very low, around 1 or 2 psi, until the temperature of the blocks heat up to an arbitrary value, say 100 degrees celsius.  At that point the pressure can be increased to another arbitrary value, for instance 40 psi.  The same would be true for the reverse process: when the blocks go below that temperature, the pressure is slowly lowered, and after the full run, set back to 0 psi.  This will be a much more complicated project, but the first step would be charting those pressure values.  Suggestions are welcome for both problems, though!

If anyone needs anymore information or files pertaining to the pressure regulator, let me know.  Thank you very much for all of your help.

Ray
0 Kudos
Message 4 of 5
(3,881 Views)
Hi

maybe this vi solves your question.
Problem is that I did not yet look in the manual and the conversion from string to number maybe does not work.
greetings from the Netherlands
0 Kudos
Message 5 of 5
(3,866 Views)