From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
08-10-2009 07:28 AM
Is there any particular reason why Open Serial.vi is set to run in the user interface?
We use the VI for backwards compatibility (and sometimes because we like refering to the port by using the port number...), and had to figure out why a serial write operation would hang whenever someone opened the date and time dialog of a date and time control...And the reason was that Open Serial.vi runs in the UI. Change that, and everything runs smoothly. It's not very practical to change library functions though...and was there a reason for this setting?
08-10-2009 09:12 AM
I guess its set to UI-Thread because otherwise it might block the other code in the VI
Christian
08-10-2009 09:24 AM
That is what it does with its current setting; as soon as the UI is busy somewhere it affects code that should not be affected (in this case serial communication).
I understand what you mean though, and in some cases that would be a valid argument, however putting just that serial VI in the UI, a VI that based on its use is bound to be called repeatedly by code that should not be affected by the UI, just makes the likelyhood of a problem higher and the debugging harder.
08-10-2009 09:31 AM
08-10-2009 09:36 AM - edited 08-10-2009 09:37 AM
As mentioned in the initial message this is due to use of the old style serial VIs...if you do a write or read with those it will lookup the VISA ref by calling the Open-VI....so as long as you use those VIs they will repeatedly call that VI, and they will freeze if the UI is busy because of the execution system that VI is set to be in. I'm not saying that it is difficult to get around the problem - you can drop the old style, or edit the execution system settings...I'm just asking if this is just an oversight that causes the compatibility VIs to have a bug...or if there was a good reason for it. As it is right now all I did to remove the problem was to change the execution system setting on that VI (easier than to rewrite everything to use VISA refs in a different way).