LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

write to multiple serial ports via ethernet serial server

I am new to LabVIEW. I have just written remote control code for VISA serial communication to a radio. I'm using the event structure to send multiple pushbutton controls and refnum inquiries. My problem is that I do not know how  to even start to expand this vi to handle multiple radios at once. The objective, final product, would to be able to remotely control 2 dozen radios via serial servers connected to the ethernet port. One serial server allows control of 8 serial devices (acting as virtual ports). Initialy the same command and inquires would be universal, to all radios. I'm not sure if I  already have myself in a corner with my initial vi just using the PC com port to the radio. I have tried to search out examples or relevant discussions. My search parameters are probably incorrect since Im' not really sure how to grow my program.

 

I sure would appreciate any assistance and/or examples. I'm just not very familiar with the more sophisticated programming yet.

0 Kudos
Message 1 of 10
(3,579 Views)
Is each com port listed individually in MAX? If so and you want to write the same commands, you would get a list of the ports as an array (i.e. VISA Find Resources) and pass it to a for loop.
0 Kudos
Message 2 of 10
(3,576 Views)

Sorry, this is a bit overwhelming since I had to look them up. No, I do not have the ports listed in MAX. So far I have only used one port.  Don't the ports have to be connected for MAX to be recognized? Then does MAX create the array or is that part of the VISA Find Resource? I'll have to find examples. Thanks for a start. I have a long ways to go I  feel.

0 Kudos
Message 3 of 10
(3,563 Views)

First, have you installed any drivers that came with the ethernet serial server?  Usually it will have software that allows you to connect with the device and create virtual com port for each port that exists on the server.  Once you do that, you should be able to see them in Windows device manager.  Once you see them in Windows device manager, you ought to be able to see them in MAX.

 

Until you do the first couple steps and see the ports within device manager, don't even bother using MAX or anything in LabVIEW.

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

Yes, I have installed the Sealink serial server S/W and detected the the virtual ports (11-18) in my VISA com configuration setup. I just didn't know what to do next to pick multiple ports at once in my vi.

0 Kudos
Message 5 of 10
(3,528 Views)
You could have separate instances of a VISA Resource Name and separate VISA Write/Read commands but since the communication will be sequential anyway, it makes more sense to me to use an array and for loop as I said. If an array and for loop are new concepts, then you need to take some LabVIEW tutorials first. A for loop will automatically index an array that is passed in from outside the loop. Say you place some initialization code inside a loop that has a couple of read/write functions. You have an array of com port names that you pass in. The first iteration, it uses the first com port in the the array (i.e com11). The second iteration, it uses the next port in the array (i.e. com 12).

You have a single wire - the Ethernet connection. You cannot truly do parallel/simultaneous operation. Making subVIs and then making them reentrant will be helpful.
0 Kudos
Message 6 of 10
(3,518 Views)

I'll go over the tutorials. It sounds like I should be able to put my existing init code and event structure inside the for loop and wire the array to the resource name. Can it be that simple? Thanks, I'll work on that.

0 Kudos
Message 7 of 10
(3,507 Views)
An event structure should not be placed inside for loop. You could place a for loop inside an event but that's not the best architecture either.
0 Kudos
Message 8 of 10
(3,501 Views)

Then what would be the best structure? here is my event structure and front panel. I need to be able to select 3 to 4 radios, out of a dozen, to program at a time.

Download All
0 Kudos
Message 9 of 10
(3,465 Views)
Sorry, I'm posting from my phone and for some reason, I can't open the images.
0 Kudos
Message 10 of 10
(3,448 Views)