08-22-2012 08:40 PM
I'm wondering if anyone else has seen problems like this.
I've been tearing my hair out over debugging some code. I have a ftont panel, I'm using some LEDs to send messages through the NI RS232 cable I bought, and have connected with a connector in a loopback fashion.
I've been trying to read the incoming messages from loopback...and based on those, changing indicators and controls on the front panel.
I could not figure why values were changing at strange times....like T's were turning to F's (I'm working with the serial data as boolean arrays).
Well, I was simplifying code, and mostly running right...but every once in awhile, it appeared that my front panel indictors, especially the values I'm changing based on the loopback serial messages would *BLINK*.
I happened to be looking at the Probe Watch window...and I saw where my probes were correctly showing on a couple spots (a left and right indicator) TTTTTTTF and TTTTTTTF......these appear at times to change T's to F's and vice versa.
I then started clicking around...and found this is almost always caused, when I click the mouse on the top of the window...the part that you usually click and drag to move a window around the Windows desktop!!!!!!!!!!!!
I can see this happen when I click on ANY window on the Windows OS desktop!!!!!!
It appears that the OS is messing with me..............?
I'm using Labview 2011, 32-bit on Win7....I believe the OS is 64 bit.
Has anyone seen behavior like this before?
Thanks in advance,
cayenne
08-22-2012 08:50 PM
When you are probing, are you looking at the actual spot where you are getting your serial data, or are you looking at it after you've done some processing? I would look at the actual raw data and use a serial port capture utility (there are several free ones on the internet) which will confirm your data is coming in correctly.
What is your CPU running at? If it is pegged at 100%, something has to give.
Is your entire VI running in the UI execution system? If you post your test code, it sounds like it would be easy enough for someone to do a loopback test of their own to confirm similar behavior.
08-22-2012 09:21 PM
@Matthew Kelton wrote:
When you are probing, are you looking at the actual spot where you are getting your serial data, or are you looking at it after you've done some processing? I would look at the actual raw data and use a serial port capture utility (there are several free ones on the internet) which will confirm your data is coming in correctly.
What is your CPU running at? If it is pegged at 100%, something has to give.
Is your entire VI running in the UI execution system? If you post your test code, it sounds like it would be easy enough for someone to do a loopback test of their own to confirm similar behavior.
Thanks for the reply. No, CPU isn't being hardly used at all...this is a new lenovo laptop.....high end Dell U2711 monitor...
Task Mgr while Front Panel running:
I'm looking after I've done some processing....
I'm new to working with serial port stuff....I don't have a serial port capture device...?
Thing is...when I run this in debug with breakpoints and stepping through...I don't see this happening. But when running at full speed, and especially when I click on any of the open windows on my desktop, along the top margin where you would click and drag a window around...I can see the serial data in the probe jump...and all data going through the serial port and being displayed on the front panel changing values...
On my VI, I'm actually constructing the byte string...sending it through the serial loopback, and receiving it and acting on it. I can see the data going in is the same as is coming out...it just seems to quickly corrupt and then come back again...like maybe it is getting interrupted by the Win7 OS....?
I can't really post the whole code here...proprietary stuff...that's why in the past, I was posting a separate, simpler vi with only the parts I was having problems with....
I think I have full support with NI...I wonder if I could send them the code to look at, with more confidentiality...?
But again, I can make the problems happen, when it and the probe window is open, in real time...by clicking on windows.
Also, this tends to explain problems I saw earlier...when running slow, all was well , when debugging with break points and stepping through. But at full speed, unexplained...things would start resetting without explanation...and without regularity.
C
I"m not sure what you are asking with "Is your entire VI running in the UI execution system?"....I have the one vi running, and only that vi is running.....
08-22-2012 09:46 PM
If you have made your simple VI, post it. It should just be encoding a boolean array to a byte string sending and receiving it and decoding it.
How are you reading data from the serial port? Is it possible that you are not getting a full message back and are not handling that situation?
NI can certainly help you. But if you want a quick resolution to your problem, you have a better chance of having it figured out here.
If it truly is in the OS (I don't think it is), running in debug mode probably won't help much since you can't really move windows around while the step is occurring.
You can find several free serial port monitors via Google:
https://www.google.com/search?q=free+serial+port+monitor
You can download them, run your code in full speed and it will log all incoming and outgoing serial data.