Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

communication between COM1 & COM2 in a PC

Dear all,

               I want to communicate between COM1 and COM2 in a PC. I prepared a document which explains the test setup which I have planned to control the simulator using a 32 bit Micro controller through PC.

Please help in this regard. Thanks in advance.

0 Kudos
Message 1 of 8
(5,474 Views)
What exactly is your question? To communicate between two com ports, all you need is a null modem cable.
0 Kudos
Message 2 of 8
(5,455 Views)

Dear Mr Knight,

                          Please read my com1_com2.pdf in my post. How do I synchronize COM1 & COM2 so that the data received from COM1 can be sent on COM2. Please go through my pdf document.

 

Please help in this regard.

 

Regards,

Thulasi

0 Kudos
Message 3 of 8
(5,441 Views)

Sorry I misunderstood.

 

First, I would recomend either a pci or USB GPIB controller instead of the serial->GPIB converter. There is not much of a price difference and you will have something that is faster and easier to use.

 

As far as reading from com1 and then sending the commands to the GPIB instrument, that would seem to be pretty straight forward. You would have a loop that is constantly reading com1 and looking for valid data. This data would need some small processing to format it into commands that the GPIB instrument would understand and then this command would be written to the instrument. Apparently, you don't have any software yet for this and I am obviously biased towards LabVIEW. In LabVIEW, the while loop would use an API called VISA for both the read and write functions. With the VISA api, the program would not card whether you used the serial->GPIB or a true GPIB controller. VISA works with both.

0 Kudos
Message 4 of 8
(5,423 Views)

Dear Mr. Knight,

                           Thank you for your reply. You said in earlier message that

 "You would have a loop that is constantly reading com1 and looking for valid data. This data would need some small processing to format it into commands that the GPIB instrument would understand and then this command would be written to the instrument".

 

Can I use C language to do the above task ? I mean, Can I read the COM1 port, process and format the command and send it across COM2 to USB-GPIB to simulator using C language instead of LabView ?

 

I am sure that am missing some detail like how to send the commands to COM2 once I receive a message/byte on COM1.

 

Help in this direction would be highly appreciated. Thanks.

 

Regards,

Thulasi

 

 

0 Kudos
Message 5 of 8
(5,397 Views)
Sure, you can use any programming language you want. I'm not sure of the programming syntax though. There are numerous C tutorials available on the web. You might try doing a search.
0 Kudos
Message 6 of 8
(5,388 Views)

Dear Mr Knight,

                           I just wanted to know is it possible to control the simulator with help of GPIB-USB convertor and C language. Or do I need to use LabView also in addition to GPIB-USB.

 

Please throw some light, so that I could just purchase GPIB-USB convertor and try writing c program to read from COM1 and process it and format it to a command and send it to Simulator.

 

Thanks.

0 Kudos
Message 7 of 8
(5,384 Views)

To repeat - "Sure, you can use any programming language you like". Put more plainly - YES!

 

When you get around to buying a GPIB controller from NI, you will get a CD with the driver and you can install examples  - including examples for C.

0 Kudos
Message 8 of 8
(5,380 Views)