LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial Communication

Solved!
Go to solution

Hello,

 

         I'm using VISA serial communication in my vi to communicate with hardware. My laptop has two COM ports COM1 and COM2. I will be using VISA configure serial port to set particular Com Port. 

         COM port will be indicated using VISA resource name. I should know the com status before other operation is done. i.e say I have selected com2 in resource name while configuring COM port, but I have connected serial cable from hardware to COM1.How can I know the difference?? I tried checking the error line,but unfortunately its not giving any error since COM1 is present in laptop.

 

 

Thanking you,

sushmith

     

Thanking you,
Sushmith
0 Kudos
Message 1 of 10
(3,219 Views)

Hi,

 

Did you try the IsConnected Property Node?

 

 

Message 2 of 10
(3,198 Views)

Hello,

         I have tried using property node immediatly after configuring VISA configure. But eventhough my COM port is connected its still giving error. Is connected is showing FALSE. error code of property node was -1073807331

 

        I have connected reference out and error out of VISA configuration to reference in and error in of property node..is it not the right way? find the attached figure.

 

 

Thanking you,

sushmith

Thanking you,
Sushmith
0 Kudos
Message 3 of 10
(3,180 Views)

Hi sushmith_ks,

 

Refer to this URL for Error

 

http://digital.ni.com/public.nsf/allkb/8EFBA8A3A660A53686256FEB006C47AB

 

 

Sorry, do not have immediate suggestion for hardware other than NI.

0 Kudos
Message 4 of 10
(3,157 Views)

Hello,

 

         The URL shows that is property node can be used only for NI hardware. but COM port hardware is not from NI. Is it the reason why property node not working in my vi? what other option I have?

 

Thanking you,

sushmith

Thanking you,
Sushmith
0 Kudos
Message 5 of 10
(3,129 Views)

Hi,

 

Another way could be to write serail data to return the Instrument Identification using the *IDN? command.

based on the response from the COM port the appropriate case to display error message could be executed.

 

Hope this helps.

0 Kudos
Message 6 of 10
(3,119 Views)

Hi naru,

 

       Sorry, I didn't understand. Can you please elobarate..?? 

 

 

Thanking you,

sushmith

Thanking you,
Sushmith
0 Kudos
Message 7 of 10
(3,110 Views)
Solution
Accepted by topic author sushmith_ks

Hi

 

The idea would be to write *IDN? (or you could select the command based on expected response from your hardware device connected to the COM port) command to the COM port individually,

 

This should return the device identification (or a known response) of the device connnected to the COM port when one tries to read the data for No. of bytes available at port.

 

If the return string is empty (or not the expected response) then that would mean no device is connected to the COM port.

Message 8 of 10
(3,098 Views)

hello all

I am currently doing a project on  ''wind power plant using SCADA and control'' and I have been asked, by my project supervisor, to use labview to represent serial data in graphic form.  However I am not very familiar with this software alot.  I am using a simple serial write and read program that i obtained from the examples of the NI.but am not able to design our requried program.plzzzz anybody help me.

 

I am relying completely on your kind consideration to help me out of this.

 

Kind regards

 

Engr Faisal

0 Kudos
Message 9 of 10
(2,854 Views)
What is your specific question? You said you have been able to use an example. Are you able to read and write to whatever you have connected? Do you get any errors? What is the instrument?

There are free LabVIEW tutorials and classes that you should take.
0 Kudos
Message 10 of 10
(2,840 Views)