ni.com is currently experiencing unexpected issues.

Some services may be unavailable at this time.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TCP/IP event

Hai

Am using Datasocket to communicate between a RT PXI and a server. My application on PXI should be made event based, i.e i need an event stating there is data at port. how do i achive this in LabVIEW 7.1. also after reading the data am suppling the data to shared memory. I need to trigger an event to read from the shared memory when there is data available, or better is there any inbuilt VI which triggers event on reciving data in memory?

Thanx in advance

Arun
0 Kudos
Message 1 of 6
(5,874 Views)
Not without using measurement studio or CVI. The LabVIEW event structure only supports UI and user defined events.

You could create a parallel thread which monitors the TCP port or datasocket, which then generates the user event. This has the added advantage that your user defined event is also your inter-thread communication (i.e. queue)...eliminating the need for shared memory. I've used this scheme successfully with cFP2020's to separate the I/O from the UI.

-Jason
0 Kudos
Message 2 of 6
(5,874 Views)
Thanx Jason

I needed another clarification, you have used events, i.e user events? or have you used notification VI's. because using user events am not sure how to generate an event in one VI and then receive it in another VI,
I tried using the register for event node to register for the event generated in another VI, but i have to give the path of the VI, also if i give the path, the "edit event" window of "event structure" does not disply the event which i am generating in that VI, kindly can u tell me how exactly you achived this.

Thanx for your answer

Arun
0 Kudos
Message 3 of 6
(5,874 Views)
I've not tried to register for user events from another VI but I'd suspect it would look like the picutre in the attachment.

The top half creates the event and writes it to an indicator. The second half uses VI server to invoke the Get Value[variant] method to read the value of the user event indicator, then registers for that event.

As I said, I have not tried this, and am unsure if it will work. You will have to make sure the VI which actually creates the user event, creates the event before the consumer VI trys to get it.

-Jason
0 Kudos
Message 4 of 6
(5,874 Views)
Yes it will work. I'm attaching two Vi's for you to look at.
Download All
0 Kudos
Message 5 of 6
(5,874 Views)
Thanx Jason

Copied, i'll try out using the VI supplied as the base and and work on it.

Thank you again

Arun
0 Kudos
Message 6 of 6
(5,874 Views)