LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to write to custom hardware via serial communication ?

I am working with hardware i'v build long time ago, receives its commands serially by an old c++ prog... work fine with Dos 6.22...
Smiley Wink yap, some Old one...

now, i would like to  send my data over a serial port, with LabView.

I have had a tough time finding a straight-forward article or resource on this forum ....could not  find any simple sample to go on...
although there are many samples, no one is simple for my need..and could not learn from it.

description of my hardware :
transmitter with rs232 jack, reciver... and all the communication is going via the power line .

I just don't know where to look for more...

 Any help would be greatly appreciated.


 Thank you.

Message Edited by kingofnoland on 01-04-2007 06:28 AM

0 Kudos
Message 1 of 44
(3,780 Views)

KONL

You didn't mention what version of LabView you are using.  You will want to use the VISA vi's for serial communication.

  • VISA Open.vi to open COM port
  • VISA Configure Serial Port.vi to configure port for correct communication parameters.  BAUD, data bits, stop bit, handshake, etc.
  • VISA Write.vi to write string to the port
  • VISA Read.vi to read data from the port buffer

I've written several programs for custom hardware.  Let me know what version of LV and I'll see if I can simplify something to send you.

0 Kudos
Message 2 of 44
(3,751 Views)
Thanks for replay....
im using National Instruments LabVIEW 8.0
btw. - you named some files but i cant see them or download......you only mentioned  them ?

i can post my old C code if u like, maybe it can help .....


sorry for my english Smiley Sad

Message Edited by kingofnoland on 01-04-2007 07:47 AM

0 Kudos
Message 3 of 44
(3,748 Views)
If you have the library installed, the VISA functions should show up on the Instrument I/O pallette.  I'm using a development system that includes a lot of stuff.  VISA may not have been included with your software.  You may need to check with your NI rep.
0 Kudos
Message 4 of 44
(3,737 Views)

There are examples shipped with labview. Goto Help->Find Examples and type in serial in the search tab. You can use these to get you started

David

Message Edited by David Crawford on 01-04-2007 02:05 PM

0 Kudos
Message 5 of 44
(3,735 Views)
i have  the VISA functions at the Instrument I/O pallette.
 I'm using the professional development system too...sorry not mention it .



0 Kudos
Message 6 of 44
(3,731 Views)
David Crawford - thanks for replay...
i'v tried them but cant get the hardware work...


0 Kudos
Message 7 of 44
(3,729 Views)
maybe it can help u all, while trying to help me, to know what kind of data i'm sending...

it is a simple number, 1-127 and it is sending like a binary code...

 127 = 1111111
15 = 0001111

sending 1 byte with this data, 200 msc delay....that is all



0 Kudos
Message 8 of 44
(3,725 Views)

OK. A few more questions, some are basic but its best to ask anyway.

Have you setup the port baud, no of bits, start/stop bits?

Is there flow control? If so what type hardware or software?

Does your custom hardware need power from any of the COM port lines such as RTS or does it have an external power supply?

What does the data that you are sending look like?

Did you get any labview errors when you tried the examples?

David

0 Kudos
Message 9 of 44
(3,724 Views)
Hi kingofnoland,
maybe you haven't got installed the VISA interactive control either? This is really an easy ready to use tool for instrumment communication through a lot of interfaces. Just select your communication port and you can directly communicating with your serial instrument.
Once this works you can be sure that the VISA vis in LabVIEW will work, too.
You should check if you have installed the VISA drivers and features (in MAX -> attachments).
Don't worry about your text language skills...that's why I love programming with wires and icons 😉
Ciao,
Olli


0 Kudos
Message 10 of 44
(3,720 Views)