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.
06-12-2014 10:18 AM
Hello,
i created a C#-DLL to communicate to a DIO-module using modbus (over LAN).
The DLL-functions are called in separate VIs.
Finally this vi´s are called in my GUI and everything runs fine when executing in Developer-Mode.
But after creating an executable of it the DI is not reading anything any more.
What can be the problem here?
After start of the program i run an initialize-vi for the DIO-module that creates a reference as return-value. This reference is saved in a global-VI-variable.
Is it possible that there are problems with global variables in executable?
Thanks for tips
06-12-2014 10:52 AM
Globals work fine in executables, can your code report errors that might occur whne openning the references?
Mike...
06-12-2014 10:57 AM
06-13-2014 01:19 AM
Hi,
have you tried to debug the executable?
Philipp K.
AE | NI Germany
06-13-2014 02:51 AM
Solved.
I checked the error-output of the read-vi that said the given reference is null.
The solution was that the Application-builder only copied the DLL that is used in the VI and not the DLL that is referenced in the driver-dll.
So the structure is:
readDI.vi calls myhardware.dll calls modbus.dll.
And the last modbus.dll was not copied by the builder.
Now i manually copied this dll into the data-directory and everything works.
Is there a setting in the builder to copy this dll?
Thx
06-13-2014 06:28 AM
have you tried to add the dll to the project an choosing the option "allways include" for this file? Is it necessary for the dll, that it is copied to a system folder?
When you are using an installer there are several possibilities:
1. adding the additional files to the project in a folder( for example supported files). you can select a destination folder for every single file.
2. executing another file after installation(another installer, batch file which copies the files to selected folder)
Kind Regards,
Philipp K.
AE | NI Germany