04-19-2022 05:41 AM
Hi
I have a vi that uses Modbus to communicate with an AC source. the Vi itself works great, but when I create an exe, I get and error (538182).
what am I doing wrong?
thanks,
04-19-2022 01:00 PM
Do you get that error when building the exe or when running the exe?
What does the error say in detail?
Did you include all relevant drivers and dependencies in the build?
04-19-2022 02:59 PM
That's a very specific error with great bread crumb trail.
Error 538182 - Modbus Error: Illegal Data Address. The specified data address is not an allowable address for the server.
Nothing about the error indicates an issue between being a VI or executable. Code it working enough to read from the device (it's just saying you are trying a function code on an address that does not support that function code)
04-20-2022 03:40 AM
My blind guess - are you loading some parameters (device address, perhaps, or a lookup table for modbus addresses to functions) from a file?
It might be that you're having the wrong path, and so you're getting a 0 back when not finding the file and not handling an error?
If the behaviour changes between VI in the IDE, and the exe you've built, then I'd check anywhere you reference file paths, and any DLLs you use (for usually the same reason, wrong path or unable to load).
Since you mention a MODBUS error and I don't know if it's likely you're using a DLL, my guess is the file for some configuration settings?