Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by Porter

  1. Do you have any plans to put this up on Github and/or vipm.io?
  2. It seems that everything is passed as float. Bitwise should be performed on integers. So maybe muparser isn't the best solution. They do mention that shift left/right can be added though: https://beltoforion.de/en/muparser/customizing_muparser.php But maybe GPower Expression Parser has exactly what you need: https://www.vipm.io/package/gpower_lib_exprparser/
  3. The muparser library should definitely be updated. I had modified the muparser library to add the : character as a valid variable name character because my variable names often include colons. To add bitwise operations like "2&3 = 2", either you would need to create a wrapper that adds these functions to muparser, or just modify the original source code like I did for the : character. I'm not sure how much work this would be. The labview code wouldn't change at all, except for specifying a new version of the muparser dll.
  4. Same as LabVIEW's zoom feature
  5. In "TX ADU.vi" of the "MB_ADU_RTU.lvclass" try setting the mask of the VISA Flush to "Flush Receive Buffer (No I/O)" If that doesn't change anything, then try replacing the VISA Flush with this: Please let me know if that changes anything.
  6. What model of USB to RS232 cable are you using? Maybe this could work? Maybe the RTS and DTR are cleared during the Flush IO buffer that is called just before serial transmission. This is the first time I would have seen this behavior though.
  7. 300 baud. That is slow! This error is generated by the slave ID check that happens after the first 2 response bytes have been received. Byte 0: SlaveID Byte 1: Function Code If the slave ID doesn't match the slave ID of the request, then you have a slave ID mismatch. Likely the data is somehow corrupt. Are you sure that your stop bit and parity bit are set correctly? You can also check the two received bytes using a property node like this: Be sure to set the string indicator to hex display.
  8. That's what I was thinking. Thanks for the clarification.
  9. It seems that there are now two forks of the erdosmiller TOML library: https://github.com/AntoineChalons/lv-toml https://github.com/justiceb/BlueTOMLSerializer @bjustice is the BlueTOML a fork of the original erdosmiller library or of Antoine's library?
  10. Anything else that should be VIMed? Median, mode, standard deviation? Everything NI_GMath and NI_AALbase please. They greatly impact application build time.
  11. I couldn't get it to return a non-zero error code. I tried Inf and NaN in the array. Dividing once for each element feels expensive. It doesn't seem like lvanlys uses it either. Both the native "dumb" mean algorithm and lvanlys overflow around the same value. Whereas a divide at each element algorithm can handle higher values. Mean Value Test.vi
  12. I'm just going to throw this out there... LabVIEW's included mean value of array function calls and external dll (lvanlys). It takes close to twice as long (depending on array size) to execute than just doing a native sum of array elements then divide by array size. Is there any advantage that the lvanlys function has over this simple native mean? Why aren't most of the lvanlys functions implemented as native LV code instead of a dll? I'd imagine that we could get some performance boost on some of them by using inlining, VIMs, and parallelized loops. Mean Value Test.vi Mean Value Test SGL.vi
  13. Glad to hear that a new converter did the trick. I can remember having an issue like that a long time ago and it was due to incompatible hardware. The main reason why I don't like the synchronous mode is because it allows only one serial read at a time, across the entire system. So for a system with multiple serial ports, you can only poll them one at a time. I recall being very confused when using the old NI Modbus code and watching the status LEDs on our multi-port USB-Serial converter light up sequentially. It had a very detrimental impact on the performance of the system.
  14. That's the first time I've heard of such a problem. I'm reluctant to implement this because from experience, synchronous R/W usually causes more problems that it solves. Would you be willing to privately share the code with me? What kind of serial port are you using? Can you try using a FTDI-based USB-Serial converter to see if you get the same behavior? Other USB-serial converters that perform well with VISA are: https://www.sealevel.com/product/2105r-usb-to-1-port-rs-232-db9-serial-interface-adapter/ https://www.moxa.com/en/products/industrial-edge-connectivity/usb-to-serial-converters-usb-hubs/usb-to-serial-converters/uport-1100-series/uport-1150
  15. Hello Paolo, Since you will be using Modbus RTU (over serial port) you would probably want to modify the "RX MEI Data.vi" in the MB_ADU_RTU class to have some logic to determine the end of the response message. Otherwise the default behavior is to wait 200ms and assume that the entire message has been received during that time. If you are OK with the 200ms wait time, then you don't need to modify anything here. Next you would want to call the "Querry.vi" from MB_Master_Serial class with function code set to 43, and the first data byte set to 13. Note that if you do modify "RX MEI Data.vi" you can use the RTU_DataBytes parameter to tell it how many bytes to expect to receive if you are able to know this before calling Querry.
  16. A nice feature would be to optionally preserve top-level comments (lines that start with #). I don't think that this is a trivial to implement, but it could be useful. And it might even be simple to preserve inline comments while we're at it (keep the comment with the key-value pair).
  17. Thanks Antoine for taking on this project. Looks like you are making some good progress already. Just a little detail, you might want to add some text at the top of the license file along the lines of: Contributions up to v1.2.1 Copyright (c) 2017, Erdos Miller Unless you received written permission to from the original owner to change the copyright.
  18. I've been toying with the idea of implementing a new TOML library for LabVIEW. I've been using OpenG variant config for years, but I would prefer to use a more standardized format for my ini config files. TOML is the best candidate for this. Erdosmiller's library is pretty good, but as the author points out, it is no longer maintained, and it didn't gracefully handle all of the datatypes that I wanted to use. It would be great to have the flexibility of jsontext but for TOML format. I'll post back here if I manage to get the project off the ground.
  19. Thanks Darin for hitting the nail on the head. Always Copy was the first thing that came to mind when looking for a workaround, but muscle memory brought me to IPES first (which does the same thing if I recall correctly). For completeness, I have added Always Copy to Loop5 of my test vi. It solves the problem nicely: Destroyed Event Ref Test_loop5.vi
  20. Porter

    Dear NI

    - LVCompare and LVMerge should be unlocked with the LabVIEW base edition. Or even better, an open source merge and compare tool could be released to the community.
  21. I think that I've encountered a bug in the behavior of Not a Number/Path/Refnum? when checking an array of event references within a loop. *LabVIEW 19.0.1f3, 32-bit, Win10* I would expect Loop1 (below) to stop within 6-7ms, however it is consistently timing out (>500ms). The result of the Not a Number/Path/Refnum? is always false even though the event refs are no longer valid. I suspect that this is related to compiler optimization because adding an in-place structure results in the correct behavior. So is this actually a bug? or should the need for an in-place structure be expected for some reason? Here is my test VI (LabVIEW 2019) to demonstrate this behavior: Destroyed Event Ref Test.vi
  22. VISA locks behave strangely in my opinion: I still use them but wrapped in a single element queue. This workaround was implemented in the Plasmionique Modbus Master's MB VISA Lock library. It is described in page 19 of the user guide: https://lavag.org/applications/core/interface/file/attachment.php?id=14276 I also describe use cases on page 10 and 11 if you are interested, I often use this VISA locking library for RS485 instruments that share the same COM port.
  23. If you only require language switching during edit-time you can give this tool a try: You will need to startup a Russian VM to view the translated VIs though. This tool pulls all of the UI strings out of a project and stores them in UTF16-LE format, then converts them back to the desired code page when applying a particular language to the project. From my experience, it is never a good idea to try to use unicode text on VI front panels.
  24. Wow. That was very fast: https://www.vipm.io/package/lava_lib_robust_csv/ What is the process for verifying submitted packages?
  25. Just submitted my Robust CSV package. The process was very smooth. I like that it is geared toward open source packages only. Hopefully this means that the quality requirements are a little bit more relaxed than LV tools network (eg. including example code in example finder).
  • Create New...

Important Information

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