LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

MULTIPLE PORTS

To all, 

 

Does multi threading needs to be implemented when running multiple ports?

 

I have created a simulator that sends serial data. I need to run at least 5 ports simultaneoulsy, but it seems not to be working.

 

I am using an event structurure, and as the device is being called to be sumulated in the event structure, then it opens the port and sends the data continuously.

 

There is an event for each device.

 

Thank you

Cosmica 

0 Kudos
Message 1 of 8
(3,227 Views)
Post your code.
0 Kudos
Message 2 of 8
(3,217 Views)

If I understand you correctly, it won't work the way you are doing it.

 

If it's in an event structure, only one port can execute -- the one associated with the event.

-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




0 Kudos
Message 3 of 8
(3,199 Views)

Yes,

 

If you want to work on 5 ports simulataneously then it should have been executed parellely (well in the parellel while loops), so that events in all the 5 ports can be explored simulataneously.

 

MRK (CLAD)

0 Kudos
Message 4 of 8
(3,185 Views)

Thank you all for your responses,

 

How can multithreading be implemented using event structures with parralel loops?

 

For instance I have 5 ports, and in each of them I do basic write and reading. Each of the ports are trigger when the user apply a START button(there is a start button for each port, therefore I have 5 events).

 

Is there any example code I could fine in the Find Examples feature?

 

Thank you,

Cosmica

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

If you want to start when a user presses a Start button, it is not neccessary to use an event structure.

 

Just make a while loop for each of the serial ports, with the Start button controling the boolean in the loop.

 

If the reading/writing is going to be very similar for each of the ports, you may want to look at making some subVIs as well.

Cory K
0 Kudos
Message 6 of 8
(3,159 Views)

I have 2 buttons that work with the port:

1. Enable- enable would allow the user to send values

2. Apply - this would update the value to be sent

 

So, multithreading could be implemented having a loop for each of the ports I need to open?

 

 

Thank you,

Cosmica

0 Kudos
Message 7 of 8
(3,147 Views)

It would really be a good idea to post your code.

 

From what you have said so far, I don't think you should be using event structures at all.  I could be wrong, but it would be easier to tell if we could see your code.

 

 

-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




0 Kudos
Message 8 of 8
(3,130 Views)