Jump to content

Porter

Members
  • Posts

    227
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by Porter

  1. Usually I would just build the library's path in a construct vi (this case it would be a mupCreate.vi) then pass it around in a cluster (or object) with the parser's handle. Is there a significant hit to the performance vs having a constant wired to the CLN?
  2. Thanks for the 2015 version. I haven't yet make the jump to 2017. Waiting for SP1. I don't know why the pointer changed after passing through mupGetExprVar. I think that something is still wrong in the call setup for the varName parameter. The libmuparser.so files you provided, are they compiled from the modified source? Wondering this because the names are 2.2.4 and not 2.2.5
  3. Thanks ensegre! I modified the muparser to include support for the not "!" operator (rather than writing another wrapper dll). I think that it is worth it. It was compiled for 32-bit and I'm using LV 2015 32-bit. I didn't consider adding Linux support as I don't have access to a copy of LabVIEW for Linux. I'll install LV 2017 today and take a look at your corrected version. I'm quite surprised about the DSDisposePtr crash. It was working on my system.
  4. Permission granted. Find it in the CR here: Looking forward to hearing your comments & suggestions. I'm sure that there are many things that can be done differently. So far I'm just happy that I stopped (frequently) crashing LabVIEW.
  5. Porter

    LV muParser

    Version 3.0.0

    399 downloads

    LV-muParser provides a simple LabVIEW API for muParser fast math expression parser. A modified version of muParser v2.3.5 is included. You will find the muParser API in the functions palette under "Addons > LAVA > muParser" muParser: https://beltoforion.de/en/muparser/ LV-muParser source on github: https://github.com/rfporter/LV-muParser This package has been tested on Windows 10 & 11 and Ubuntu Linux 20.04. Documentation here: https://github.com/rfporter/LV-muParser/blob/c413686832caaff8179de923b388e21f9ca09161/Docs/LV-muParser User Guide.pdf
  6. View File LV muParser LV-muParser provides a simple LabVIEW API for muParser fast math expression parser. A modified version of muParser v2.3.4 is included. It will be installed to your "<LabVIEW>\resource" directory. I have added support for the "!" (not) operator as well as added ":" as a valid character for variable names. You will find the muParser API in the functions palette under "Addons > LAVA > muParser" muParser: https://beltoforion.de/en/muparser/ LV-muParser source on github: https://github.com/rfporter/LV-muParser This package has been tested on Windows 10 & 11 and Ubuntu Linux 20.04. Submitter Porter Submitted 08/25/2017 Category General License Type BSD (Most common)  
  7. I will ask permission from my employer to share the code on LAVA. I'll keep you posted.
  8. Thanks again ned! DSNewPtr and MoveBlock did the trick. There is also a nice GetValueByPointer.xnode that really helps getting string values from pointers. muParser seems to be about 3x faster than the expression parser provided with labview and it supports logical operators.
  9. Please try like this: Note that the default baud rate for the EM1200 is 19200 bps. Also note the 250ms delay between polls.
  10. Hello Senthil, I would recommend trying the "MB_Master Comm Tester" (you can find this in LabVIEW's example finder) to test the communication with the device. This way you can just focus on the testing the serial port settings and register addresses before writing your own code.
  11. I suspect that you've entered the address of 2000 in decimal format instead of hex 0x2000. Please check the radix of the "starting address" control. d = decimal, x=hex. 2000 in decimal format equals 0x07D0 in hex as indicated in the sent command 01 03 07 D0 00 01 84 87. Not sure why its reporting bad CRC instead of exception code 2: invalid data address (error 403462) but it might have something to do with how the E5CC handles a read request at address 0x07D0.
  12. I would recommend trying the "MB_Master Comm Tester" (you can find this in example finder) to test the communication with the unit. This way you can just focus on the serial port settings and register addresses to start. I've successfully used the Plasmionique Modbus Master library to communicate with an Omron E5CN controller. By default, I think that the units are configured for 4-byte mode, so the temperature PV is located at holding register address 0 and the number of registers that you read should be 2. I also recommend that you start with a 1000ms timeout.
  13. Have you taken a look at MuParser yet? http://beltoforion.de/article.php?a=muparser&p=interface
  14. 10ms seems like a very short polling period for a serial device. 100ms is more realistic. Of course it depends on baud rate, number of transactions, FIFO buffer settings etc... But yes, you can just poll the PLC in one loop (as shown in the simple serial example), then put the data into a queue or user event to pass it to other loops. I would recommend looking into the producer/consumer design pattern.
  15. For #3, check the "MB_Master Simple Serial.vi" example located in "<LabVIEW>\examples\Plasmionique\MB Master\" or search for it in the Example Finder.
  16. Please post your code, or send it to me via PM and I can take a look. #1, it would be very useful to know what error is reported when the read fails. #2, see attached. 0x8 is the low byte, 0x9 is the high-byte, the output is a single precision floating point number (32-bit) #3, it is very important to run "Close Session.vi" before exiting the program. This releases the lock on the serial port. Join registers to float.vi
  17. I haven't run into this error yet with this Library. It seems to be generated when VISA can not access the serial port. http://digital.ni.com/public.nsf/allkb/6807113B057FDE4C86256B41008212ED Sounds like the first thing to try is close LabVIEW and reboot the computer.
  18. Hello ASalcedo, Yes to both of your questions.
  19. Version 1.2.1 is live on LabVIEW Tools Network. If you like our library, please consider leaving a review on the LVTN product page: http://sine.ni.com/nips/cds/view/p/lang/en/nid/214230
  20. Thanks for the positive feedback I used to implement a centralized queued state machine for managing each comm port. Perhaps my approach was flawed, but one reason why I stopped doing that was because I found myself having to gut existing instrument drivers to adapt them to my framework (because the VISA resource was in the handler and the logic was in the device instance). By instead forcing VISA locks to behave (as I expected), I can just wrap the existing driver with my device instance. This also allows me to develop device code that is more portable (completely independent of my application's framework).
  21. Thanks ned! I hadn't come across this function yet. I'll have a look at it this weekend.
  22. In particular, how can LabVIEW interface with the DefineVar function: http://beltoforion.de/article.php?a=muparser&hl=en&p=defining_variables I see that the function expects a pointer to a variable from LabVIEW. MuParser stores this pointer internally and dereferences it in the Eval function. I doubt that the value that I passed along the wire into the DefineVar function will (reliably) remain at the same memory address by the time Eval is called.
  23. Has anyone taken a crack at calling MuParser or MuParserSSE from LabVIEW? http://beltoforion.de/article.php?a=muparser&p=interface
  24. I'm looking forward to trying it out. I wonder how you handle forbidden combinations of: - Preallocated clone execution when there are dynamic dispatch terminals - Inline subVI into calling VI when there are dynamic dispatch terminals - Inline subVI into calling VI when there are property nodes on the block diagram - Inline subVI into calling VI with error handling - Inline subVI into calling VI with non-reentrant execution
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.