07-15-2012 02:21 PM
I want to use the wagoNModbus.m function within LabVIEW to control a series of solenoid valves from a WAGO 750-841 PLC. (See link to download the Matlab file under "Valve Control Software" at: https://sites.google.com/a/lbl.gov/microfluidics-lab/valve-controllers/wago-controller). The function uses the public modbus library and the associated .dll files are currently stored in a sub-folder in the same folder with wagoNModbus.m. This function defines several Methods, which are called, e.g., by the test script: wago_object_test.m, which can also be downloaded from the link above. I have noted a comment that sub-functions within a function are only accessible within the main function (http://zone.ni.com/reference/en-XX/help/371361F-01/lvhowto/mathscript_function_syntax/), but do not know whether this would also apply to the Methods defined by wagoNModbus.m? Do I need to break out each of these Methods and save them as separate functions?
Also note, .m is not a valid file extension for attachments on these message posts! Someone should fix that...
08-24-2012 04:21 PM
Hello KMU,
Thanks for the heads up on the .m file. For reference, here is a list of the LabVIEW MathScript Known Issues and Limitations, but as a general rule the methods should work correctly. One thing to note anytime importing a third-party .m file is to confirm the syntax against the functions list in the LabVIEW 2012 MathscriptRT Module Help.
An easier approach might be to utilize this example LabVIEW project that WAGO provides that demonstrate simple socket connections to the WAGO Controller.
Thank you,
Deborah Y.
08-24-2012 07:28 PM
I gave up on the MathScript and was responsible for WAGO finding the example files you mention, which had broken links. I've adapted that approach for my application and it works great. I'm still curious about the problems with the MathScript function, but don't have the time to chase it down further at this point.