NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Member KMU
Member
KMU
Posts: 3
0 Kudos

MathScript User-Defined Function with Multiple Methods and .dll files

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...

Member
Deborah_Y
Posts: 150
0 Kudos

Re: MathScript User-Defined Function with Multiple Methods and .dll files

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.

LabVIEW Product Marketing Engineer
National Instruments
Member KMU
Member
KMU
Posts: 3
0 Kudos

Re: MathScript User-Defined Function with Multiple Methods and .dll files

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.

By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page