LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

1D Waveform to String fore serial I/O

I created a VI with a sine wave generator following the Activity 11 tutorial in LabView 6i. I now would like to control a power supply through an RS232 port with this generated waveform. I cannot figure out how to get the waveform data converted to a string such that I can write it to the serial port.

Rigth now I am creating a 1D array from the waveform data but even after searching the documentation for a couple of hours and trying various array string conversions in LabView I haven't found the solution. I am using the precanned VISA Write VI from the Serial I/O subpallette.

Help is much appreciated.

If there is a better way to do this I'd appreciate to be pointed in the right direction.

Thanks,
Robert
0 Kudos
Message 1 of 2
(2,777 Views)
This item is really two questions: it involves both serial and instrument control matters.

There isn't any detailed information in your question about your actual instrument, so I can only give you a general framework on how to handle this type of problems.

Can be that your power supply come with an instrument driver you can incorporate in LabView, or it can be available as a separate item. The instrument driver stays as an interface between your program and the instrument itself, providing you with high level vis to manage the instrument.
Ask the vendor for it or search the Instrument Driver Network (http://zone.ni.com/idnet97.nsf/browse); eventually write a question in the Instruments Drivers / IVI category in the Developer Exchange.

If there isn't any driver, you must handle the protocol of communication of the power supply, that is the 'vocabulary' it knows and understands. Whichever is the setting you want to drive with your signal (tension? current? both?...), you must know the structure of the message to send to the instrument to set it... and this information lies in the power supply documentation and nowhere else. You will need also to know the response time of the power supply to a setting message, in order not to overcharge the instrument with a lot of messages it can't manage, maybe causing some error or unexpected behaviour in your hardware.

Only at this point you can try to build your message and send it to the power supply. Generally this type of messages are structured in some constant parts (instrument ID or address, identification of the setting to drive...), a variable part (the actual setting to send) and maybe some termination character(s). I'm afraid I cannot be more detailed than this not knowing the protocol...

Howewer, I suggest you to try first the communication with hyperterminal or other simple serial programs, next to send simple messages by your program and look at the indtrument reaction, and only last to send the complete waveform to the instrument.

Hope I have helped you a little.
Roberto


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 2
(2,777 Views)