05-18-2015 06:46 AM
1. I have attached a serial VI.
2. Usually I have to select com port & then start the VI. But how to do that: first I start VI & then VI ask sends a pop message to select comport & then run?
3. Serial VISA has timeout attached with it. But suppose my system is connected continuously for days. and user can send data from outside to VI at any given point. How to dela with it?
4. Every time I rerun the VI it takes last values of control and indicator. How to do that every time I start VI, control/indicator set to some predefined values
05-18-2015 06:55 AM
Please stick with your original thread!
Don't create duplicate threads!
05-18-2015 07:00 AM
Ho thats not duplicate thread.
Both have different queries, subject lines may look similiar.
05-18-2015 07:02 AM
05-18-2015 07:17 AM
@Vindhyachal.Takniki wrote:
1. I have attached a serial VI.
2. Usually I have to select com port & then start the VI. But how to do that: first I start VI & then VI ask sends a pop message to select comport & then run?
3. Serial VISA has timeout attached with it. But suppose my system is connected continuously for days. and user can send data from outside to VI at any given point. How to dela with it?
4. Every time I rerun the VI it takes last values of control and indicator. How to do that every time I start VI, control/indicator set to some predefined values
1. No you didn't
2. Adding a dialog box is an option. Just make its output for the selected port go into the Configure Serial Port. Another option is to read the port to use from a configuration file or text file.
3. You could just let the timeout happen and ignore any of the data when you do have a timeout. If you do not know when your data will come in, I use the Bytes At Port node to see if there is any data in the port. If there is data, read your entire message. If there is no data, throw in a wait (something like 50ms is usually a good amount).
4. There is a VI method called Default Values.Reinitialize All To Default
05-19-2015 05:01 AM
1. Sry I didn't attached the VI.
2. I have created a dialog box as in attached dialog.vi. But when I create input in dialog box, it has option of numeric/checkbox only. So datatype of both configure serial port input donot match as error is in vi.
3. I have created a function byte at node as in attached serial.vi. But it still has visa configure function & its timeout?
4. For initialize control to default, I have done is in attached default.vi:
Right click Numeric2->Data operation->make current value default
RIght click Numeric2->create->invoke node->reinit to default
Now a object appeared in block diagram as shown in VI. It has error in & out.
What to do now. Do I leave it unconnected??
But after placing this in VI, control always init to default whenevr re-run.
05-19-2015 07:06 PM
Vindhyachal.Takniki wrote:
3. I have created a function byte at node as in attached serial.vi. But it still has visa configure function & its timeout?
But you didn't do anything with it. The idea here is to do a comparison with the number of bytes in the port. If there are more than 0 bytes, then do your read. If there are 0 bytes at the port, you wait something like 50ms.