Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   LabView and Data Acquisition (http://www.chiefdelphi.com/forums/forumdisplay.php?f=150)
-   -   Labview and communication with peripheral device help (http://www.chiefdelphi.com/forums/showthread.php?t=52567)

jaijaidin 23-01-2007 15:26

Labview and communication with peripheral device help
 
hello, i am new with labview and i need some help.
My pc has labview 8.20 installed, with MAX version 4....

i want to communicate with my pc, using Labview, through serial port, with a antenna controller. This antenna-controller is adevice which accepts some commands (2 character commands) and responses on it (it means, controller should send a 2 character respons).

How can i configure it by labview? :confused:

Is there any vi correspons to serial port communication and can handle/send/receive character or string value?:confused:

please help me, if u want to know more, pls also let me know.:)

Danny Diaz 23-01-2007 15:35

Re: Labview and communication with peripheral device help
 
First thing you want to do is install NI-VISA. This allows LabVIEW to talk with the serial ports. This also adds the Serial Communication VIs to LabVIEW.

You can find these VIs in the functions palette through the following path:

Data Communication -> Protocols -> Serial

These VIs will allow you to write and read bytes to/from the serial port.

If you need any other help let us know!
-Danny

jaijaidin 26-01-2007 06:19

Re: Labview and communication with peripheral device help
 
Quote:

Originally Posted by Danny Diaz (Post 563385)
First thing you want to do is install NI-VISA. This allows LabVIEW to talk with the serial ports. This also adds the Serial Communication VIs to LabVIEW.

You can find these VIs in the functions palette through the following path:

Data Communication -> Protocols -> Serial

These VIs will allow you to write and read bytes to/from the serial port.

If you need any other help let us know!
-Danny

thnx for your help....this VIs already installed. I have some time to play with this.
I have a further questions....if i send a character (or 2 character) command from labview through serial port (basically i have to use RS232), to the controller, can will it responses? The prevoius pascal program, controller did responsed with 2 CHaracter return......wht will i do for the same case in labview?

Danny Diaz 26-01-2007 19:17

Re: Labview and communication with peripheral device help
 
In LabVIEW we use a single VI for write, and a single VI for read. So, if you want to talk to a device, you would "write" your 2-character string to issue a command to the device, and then you would "read" a 2-character response from the device. The CMUCam2 camera communicates via serial in exactly the same way.

If the response is always known, but you just need to issue the command and wait for it to be executed, I would recommend just using the VI included in the CMUCam2 library called, "query for result from serial port.vi". This function is very nice because you can input what the command is, what you expect back, and you can provide a timeout in case it doesn't give you what you expected in the time specified.

If the response isn't always know, but the byte size is, then just use the primitive read/write functions - write your 2-byte string, then read up to 2 bytes from the serial port. It's fairly straightforward.

If you need examples, give me an example of what you're trying to do (exact communication) and I'll show you how it should look in LabVIEW.

-Danny


All times are GMT -5. The time now is 00:18.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi