03-19-2020 08:48 AM
Hi Everyone,
I'm having a really weird issue. I'm running LabWindows/CVI and I'm doing some communication via an RS232 serial port from my PC to a DUT and it's doing a full readout of the eeprom of the device through some microcontroller on the DUT. Every now and then one of the transmissions from the PC is bad and so the microcontroller sends a request for the PC to retransmit the message. I looked into it and found that the bad message had went high for an extended period of time (maybe 15ms) and that caused the microcontroller to timeout and ask for a retransmission. Now it gets weird, when I run the NI MAX application I never have this issue. The RS232 communication runs fine and I don't see any high periods with the comm signals. If NI MAX is off then the issue comes back. Does anyone know what could be causing this? Does NI MAX change any settings of any ports when it's ran?
Thanks,
Dave
Solved! Go to Solution.
03-19-2020 09:45 AM
My guess is the system is running with a 16ms clock resolution by default.
MAX configures the system clock resolution to 1ms. Is your application requesting the system to run with the 1ms clock?
I found some snippet CVI code to configure this:
03-23-2020 08:31 AM
I looked into this more and it gets even weirder. It seems that when I run examplefinder.exe and NI dsitributed system manager (SystemManager.exe) I get the same results as I did when running NI MAX. If I run any of those three applications then the RS232 communication is fixed. All of those are in the C:\Program Files (x86)\National Instruments... so maybe it's some kind of admin access issue? Has anyone seen anything like this or have any ideas? I also don't have admin access normally. I have to request it from IT each time I need it.
03-24-2020 02:28 AM - edited 03-24-2020 02:31 AM
All of these applications are likely build using LabVIEW, which by default applies the multimedia timer reprogramming on startup (unless a specific INI setting is present in its configuration file).
So that isn’t so strange but just confirms the earlier recommendation from Craig
Calling this meultimedia timer function early in your application isn’t quite like rocket science (and the according call to reset the timer before exciting neither). Rather than trying to find apps which make your serial port work I would have tried that recommendation already long ago.
it’s basically a bug in the virtual comm driver to rely on that timer being set to low latency and not take care of that somehow. In fact being a kernel device driver I would say there would be much better ways inside the Windows kernel to get accurate timing without relying on the very old (Windows 3.1) legacy timer that apps can reprogram at will!
03-24-2020 08:35 AM
Thanks Craig! That did it! I tried it when you first mentioned it, but I couldn't get my program to compile with windows.h, so I moved on. Nothing else I tried worked or gave me any additional info, so I came back to this and worked on getting it to compile and that did it. Thank you so much!
03-26-2020 04:20 PM
This is Huge .... Thank You!! Craig for you help with this 🙂