Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Interfacing RS232

Solved!
Go to solution

I want to drive a magnet with a power supply (want to increase the volatage from first negative to positive then onto negative or vice versa) using LabView programming via rs232 port. I am at the beginning of learning LabView. Could you please suggest some ideas for programming and comunicating through this port?

 

Gnani

0 Kudos
Message 1 of 9
(5,591 Views)
Solution
Accepted by topic author Gnani

Open the file "C:\Program Files\National Instruments\LabVIEW 8.6\examples\instr\smplserl.llb\Basic Serial Write and Read.vi".

 

Refer to the instruments m,anual for the commnads that the device recognizes. 

 

Write the command in the 'string to write' field and setWrite and Read to True. Run the VI. See what is happening.

------

"A VI inside a Class is worth hundreds in the bush"
യവന്‍ പുലിയാണു കേട്ടാ!!!
0 Kudos
Message 2 of 9
(5,571 Views)

Thank you for the details. I am using a power Kikusui PCR500M power supply. I tried using that example program with visa resource name ASRL1::INSTR and the program seems to be performing the writing but an error message appears for reading (Error-1073807339 occurred at VISA Read in Basic Serial Write and Read.vi). Could you pls give a suggesion to proceed further?

 

Thanks

Gnani

0 Kudos
Message 3 of 9
(5,542 Views)

Gnani,

 

To which COM port did you connect the instrument? Have you used the same port's resource name in the program? This particular error means that the operation timed out. So either the device is not connected to the port that you have specified or it can be that the device is not responding. Are you getting the error after write VI or read VI? Placing a probe after write and read VIs will help you to find this out.

------

"A VI inside a Class is worth hundreds in the bush"
യവന്‍ പുലിയാണു കേട്ടാ!!!
0 Kudos
Message 4 of 9
(5,526 Views)

The port that I connected is a nine pin female port. I used the resource name ASRL1::INSTR as it worked with the EASY CONTROL software provided by the instrument manufacturer (PCR500M, Kikusui) to control the voltage, current, frequency etc through this port but do not have the facilities to ramp the voltage from (-)ve to (+)ve then on to (-)ve in a cycle for a specified number of times, for which I am thinking to use LabView. I was a bit familiarising with interfacing using turbo C for some other experiments (6 years ago) but forgot all of those now. I am new to LabView and my writing may sometime mislead you for better understanding. I think the example program you mentioned should help to make initial communication with the instruments. I run the program with resource name ASRL1::INSTR without changing all other parameters including the ‘string to write’ field by clicking the knob HIGHLIGHT EXECUTION button on the block diagram and it shows OK up to read string, showing bytes at port 0 and then an error message displayed as I mentioned earlier, when both write and read button set to ON. I could not find any commands in the instruments manual for the device to recognize. When I switched OFF the read button it did not display any messages and I think the error occurred after read VI as I did not put any command in the string to write field. Also I noticed that there was a tiny ‘click’ sound in the instruments every time when I run the program. I can send the LabView block diagram by tomorrow to find where the execution of the program stops. Could you please explain a bit on how to place a probe after write or read as you mentioned?

 

Thanks. gnani

0 Kudos
Message 5 of 9
(5,510 Views)

I have now found the commands for the instruments as you mentioned and it worked well with adjustment on baud rate setting. Using this program only a few controls can be done. e.g: switching ON/OFF the output voltage, changing the frequency. etc.. Now I want to design a Labview block program to make a voltage ramp as I mentined earlier. Is there any program for this in order to modify for my purpose?

 

Thanks a lot.

 

0 Kudos
Message 6 of 9
(5,486 Views)

Glad to her that you were able to communicate with the device.

 

Assuming that your device supports setting of output voltage, you will have to write the code for ramping of output voltage.

 

To generate a ramp, you will need initial voltage, increment voltage and no.of steps (or final voltage). Using a while loop, create a VI that will increment the voltage fro initial value to final value at the specified increment voltage. In each iteration of the while loop, send the new voltage value to the device.Stop the loop once you reach the final value.

 

 

------

"A VI inside a Class is worth hundreds in the bush"
യവന്‍ പുലിയാണു കേട്ടാ!!!
0 Kudos
Message 7 of 9
(5,484 Views)

Hello!

 

I have the same problam, as you 6 six years ago. I have to control a kikusui pcr500m through labview via rs232 interface. Could you send me the vi-s you created for this? Thanks in advance.

 

Roland

0 Kudos
Message 8 of 9
(3,955 Views)
0 Kudos
Message 9 of 9
(3,950 Views)