06-18-2015 04:27 AM
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.
06-18-2015 04:54 AM
Hi archit0392,
Will case structure ok for you? when all the parameters are ture, the 2nd pc respond to it.
06-18-2015 05:12 AM
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
06-18-2015 05:36 AM
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
06-18-2015 05:43 AM
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
06-18-2015 05:49 AM
This is still not clear.
If this is a comunication problem try out comunicating with NI PSP.
Can you share your code ?
BR,
Vincent
06-18-2015 06:36 AM - edited 06-18-2015 06:37 AM
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.
06-18-2015 06:41 AM
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.
06-18-2015 06:44 AM
06-18-2015 09:59 AM
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.