LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

event structure-Plese help

I have made a GUI for communcation between two pc with various parameters.

I have used an event structure for 1st PC because i have 3-4 parameters which i want to run as i press the boolean on front panel.

However my problem is suppose I press the 1st boolean, I want the 2nd pc to receive and respond that data has been received. And since there are 3-4 parameters, i will have to use event structure for 2nd PC too. But there will be no one to control front fanel of 2nd PC.

So, how do i do it. Any alternative to event structure in which it resoponds to data recieved and not on user input.

 

Thanks. 

0 Kudos
Message 1 of 11
(4,061 Views)

Hi archit0392,

Will  case structure ok for you? when all the parameters are ture, the 2nd pc respond to it.

0 Kudos
Message 2 of 11
(4,034 Views)

Hi,

Actually i want the 2nd PC to send differently for different inputs on 1st PC.

ie- suppose I execute 1st parameter in PC-1(using event structure), the response would be X (suppose) from PC-2 to PC-1.

but when i execute 2nd parameter in PC-1, the response i want is Y (and not the same x) from PC-2 to PC-1. and i cannot use event structure in PC-2 as it would then be have to pressed manually by user in PC-2 also.

 

Thanks

0 Kudos
Message 3 of 11
(4,029 Views)

Are those computers in the same network ?

You can command VI via TCP/IP.

Don't get what's your true problem. Event structure ? Comunication between your two computers ?


BR,
Vincent

0 Kudos
Message 4 of 11
(4,006 Views)

I am using a serial communication (ie connecting two pc's using connector..)

 I am using a event structure in PC-1 to handle mutiple cases.( in my case it is 4 cases)

I want that the PC-2 should respond differently to different case of event structure

ie when I execute case-1, PC-2 responds in one way by sending a return acknowlegement.

however when i execute case-2, PC-2 responds differently by sending different acknowlegement from as that of case-1

So how do i make a labview based program for 2nd PC. because here event structure cant be use 

 

0 Kudos
Message 5 of 11
(3,994 Views)

This is still not clear.

If this is a comunication problem try out comunicating with NI PSP.

Can you share your code ?

 

BR,

Vincent

0 Kudos
Message 6 of 11
(3,988 Views)

Sounds to me, like the way to go is network streams, that way you can buffer the data and also wait for a new action to be sent.

 

Edit: also "normal" Variable communication might also work for your case, just lose the Event structure on the machine without interface.



Remember Cunningham's Law
0 Kudos
Message 7 of 11
(3,964 Views)

In my experience with serial communications, you will want a loop for nothing but reading from the port.  You can use a global or a Notifier to tell this loop to stop.  You will want a second loop for GUI and message handling.  So I encourage the use of the Event Structure here, using User Events to send the commands/data to this loop.  Then you will want a third loop for sending commands through your serial port.  Send the commands/data to this loop using a queue.

 

So the process will go like this for PC-2:

1. Read command through serial port.  Serial Read loop sends this message to GUI loop via User Event.

2. GUI loop processes user event, does whatever is needed, and sends the response to the Serial Write loop via a queue.

3. Serial Write loop reads the message to send from the queue and writes it through the serial port.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 8 of 11
(3,953 Views)
Instead of an event structure on pc 2, it sounds like you just need a simple state machine. One state to listen to messages and a state for each message received.

0 Kudos
Message 9 of 11
(3,950 Views)

Please see the  VI attached. This is the sender's side labview program

My task is to communicate various cases of event structure to a subsystem ( like laser) using serial communication and when it receives data, it send a acknowlegement in form of another hexadecimal code to 1st PC.

So for laser standby I need a code which is different from emission On or emission off...

My problem is how do i make the 2nd subsytems labview program.

Since i have to control only through 1st PC, I cannot include event structure in 2nd PC's program because in that case we need to manually change value in front panel of the program. 

If i use state machine, will I be able to communicate between two different LabVIEW programs.

 

0 Kudos
Message 10 of 11
(3,915 Views)