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-12-2022 10:17 PM
I wrote a program to communicate with several devices using RS485 protocol. The VI works, I can read-write to each devices as I wanted. However, when I build it up to executable, apparently, none of RS485 devices have communications. I wrote another VI to control one of devices, and both VI and executables are OK. It looks like the executables are unable to control multiple RS485 devices, but why?
I tried to install VISA run time engine, didn't solve the problem. Attached is VI that tests all devices and VI that tests only one devices.
Urgent, please help.
Thanks!
08-12-2022 10:24 PM
Both VI and executable are tested on same computer.
08-13-2022 05:14 AM - edited 08-13-2022 05:21 AM
In your EXE, is the VISA Resource drop down list populated? I mean, can you see the list of available COMs?
Moreover, your first loop (the loop you use to wait the user to click Start) doesn't have a time control. You should use a Wait function.
Finally, put some debug indicator in order to understand if your code stucks in some points.
08-13-2022 08:13 AM
Do you mean both applications fight for the same serial port for different devices on that serial port?
08-13-2022 08:08 PM
Besides missing a bunch of sub-vi's so we really can't troubleshoot it. That code architecture is so bad, the fact that it works at all in all surprises me. You have flat sequences inside of flat sequences and even a stacked sequence inside of a flat sequence inside of a flat sequence...
You need to go through some tutorials and understand what they mean by Data Flow programming.
But in general multiple devices on an RS-485 bus is nothing special unless it uses some other communication protocol like Modbus.
08-13-2022 11:17 PM
I have dropdown list, so call the COMs. The VI works fine. It is just the exe. I don't know how to debug exe while it is running, it is not supposed to run with Labview installed.
08-13-2022 11:26 PM
The sub Vis are based on Modbus. The device sent binaries, and Labview only process ascii.
Anyway, it is just a code to test that my devices are under control work. The VI with multiple devices works but not the exe. It looks like Labview needs to install something for exe to work on multiple devices. I wonder if someone has the experience.
I just heard the multiple device exe works in my friend computer, but we don't know who ever did something extra.
08-13-2022 11:35 PM
I think it is sort of like what you guessed. But I have given each of devices a address#, so that they won't fight each other. The weird thing is Vi with multiple devices works, until it has been compiled to exe. Both Vi and exe of single device works. The serial port communication is used modbus to process binary to ascii.
Anyway, a friend has run the multiple device exe in his computer, it works. I wonder, I need to add something to Labview run time engine..... I just installed Visa run time engine, it ididn't solve my problem.
08-14-2022 03:40 AM
Full VI (with sub Vis) are attached.
08-16-2022 05:50 AM
I kind of solved the problem by accident. The executable starts running automatically when you click it. And channeltest.exe looks like stucked somewhere. But when I click stop and terminate the program, and run it with channels has be selected by last run, it works as expected.
I though it might take some time to for the computer to commute to the port, so I add a frame to wait 1min after I click start. I started the program, choose the right port from port list, then click "start", and the computer will wait a minute to process next frame, still, it didn't work. Looks like the exe won't figure out the port no matter what at first run.
Anyone has idea how to click exe file without running it after click?