Jump to content

smithd

Members
  • Content Count

    739
  • Joined

  • Last visited

  • Days Won

    42

Everything posted by smithd

  1. I dont think so, I forgot it was in there. Seems like a good idea though. Just needs to be added to TCP Master::Initialize Master and TCP Slave::wait on listener. This is illegal per the spec. Its obviously not difficult to change this, but...its also not hard just to set the value after initializing the modbus library. I think I see what you mean and attached an implementation. Looks to be about 3x faster (edit: 2x with debug off) to read from the lookup vs calculating it out. Just a thought tho, it probably makes other code around it slower by completely trashing your CPU cache (its about 1/4 of the L2 cache on a zynq-based cRIO). If visa times out it returns whatever is in the buffer. If it happens to time out mid-packet (as may be the case on linux rt or with usb-serial adapters) then you have half the packet in your read loop and half out on the bus. This isn't important for the master, since if you time out you pretty much have to flush the buffer, but for the slave its sitting there waiting for data forever, so dealing with partial packets is annoying. Also, this was like 6 years ago so I may be wrong, but at the time I think one of my goals was to make the serial and tcp functions act the same. Thats why TCP also uses the 'buffered' feature. I do, thats why I make sure to enable the term char. However it has to be CRLF, LF by itself is not acceptable. You may very well ask in which situation you would get a LF by itself -- I don't know, but I do know that its a 5c chip wiggling the voltage on some wires back and forth at an absurd speed, so I figure it can't hurt to check Woops. That method really only exists to make sure its not broadcast, so in the 99% use case it happens to work. Otherwise ascii doesn't care. Fixed, though. I don't actually understand what the problem was with this. As you said in your comment on that issue, each access should be synchronous for a given master or slave, so there is no such thing as multiple transactions outstanding on the connection. The transaction ID check just sort of verifies that. If an error occurs, you must close the connection and reset. I can't think of any reason that would not be the right response, can you? I'm also confused by this because that part of the code was implemented by Tanner, who is the person who posted that issue to yours, so presumably he thought that code fixed the issue? Note that this behavior (close and reopen) is different from serial (wait, flush the buffers, and hope things start to work again), not because the serial way is better but because serial is a 5c chip twiddling the voltage on some wires. The serial version has no connection to close. The idea of the pluggable transport was to support any modbus adu over any network type. I've definitely heard of RTU over TCP, this would be to support ascii over tcp the real answer is that it was easy and it kept the implementations mirrored. crc bench.vi crc.vi
  2. I can't see what you're actually doing but I'd say this seems expected...sqlite has somewhat squishy types. https://www.sqlite.org/datatype3.html "Any column in an SQLite version 3 database, except an INTEGER PRIMARY KEY column, may be used to store a value of any storage class." "Any column can still store any type of data. It is just that some columns, given the choice, will prefer to use one storage class over another. The preferred storage class for a column is called its "affinity"." If that makes you feel bad, just remember that almost every interaction you have with your bank relies on a technology whose type system is pure madness.
  3. You might just ask your field sales. They can, on occasion, do nice things.
  4. However this will increase latency. That is the tradeoff. To be reasonably efficient with the network you'd need to transfer bursts of ~20 samples over wired ethernet. How real-time is real time? What does the labview code do with the information? Then my answer would be that you should write to a file, but as above it depends on exactly how important it is. What happens if you lose a sample? What happens if the network disconnects for 30 seconds? Yes, you would have to split the file up yourself. The strategy I follow is to have a directory /data with a file /data/temp.ext and a subdirectory /data/done which contains data1.ext, data2.ext, etc. I then use the built-in labview FTP (I believe the connectivity palette but I'm not sure) functions to fetch files out of the /data/done folder. That way I don't accidentally pull off a half-finished file. This appears to be automated in python: https://docs.python.org/3/library/logging.handlers.html#rotatingfilehandler and https://www.blog.pythonlibrary.org/2014/02/11/python-how-to-create-rotating-logs/ If you don't like FTP for some reason, someone put together a winscp wrapper library: https://lavag.org/topic/20474-free-labview-winscp-library/?tab=comments#comment-124582
  5. There does not appear to be anything standard about that 'normal' file. I don't think I've ever seen such a file before. To give you a clear picture of the complexity of what you are asking, and why drjd is quite right....just looking at that example I would assume the following about your file: The entire file is a single json object The first line is the 1 and only key within that object there is a CRLF between the key and its value The rest of the file is the value of the single key The single element is itself an object This object consists of key-value pairs separated by "-" and delimited by CRLF Every value is a string Your file cannot contain strings which contain CRLF Following these rules, your json output would be: {"Details": {"Name":"abc", "Organization": "anonymous", "Location": "xyz"}} If that is what you want, then my only answer is that you will have to procedurally parse the entire file from a string and construct the json object manually. If that is not what you want, then you should figure out the rules for your "normal simple" file. Once you figure out the rules, you will still have to manually write the code because that isn't a standard computer-parse-able format that I am aware of. If there are no rules, then you may need to consider a different strategy for whatever it is you are actually trying to accomplish. For example if you are making your files into json to make them easier for a computer to parse, then you'd be better of just shoving all these "normal simple" text files into elastic search or splunk and never look at them again.
  6. the dev suite version worked for me without issue: http://www.ni.com/en-us/support/downloads/software-products/download.developer-suite-all-inclusive.html Downloaded about 5x faster than the web installer if you're also having trouble
  7. Still broken, don't install To be clear I used the standalone installer for 32 bit since that took 3 minutes to download and the web installer would have taken 28 hours.
  8. I'm super confused...it sounds like you just want to stream data, right? So latency isn't important -- just throughput. So turning off nagle won't help. However you're introducing a latency issue by having LabVIEW request data by sending a string with "?" in it? The stated goal is 7 kHz * 50 bytes, which is 2.8 Mbit/s -- hardly anything. But when you introduce round trip communication into the streaming pathway, you're introducing slow performance. Can you clarify if there is an actual need for this back and forth? How important is reliability? If latency is unimportant and reliability is very important, I'd suggest writing your data to disk on the raspberry and then ftp/scp/webdav-ing it off. If reliability is not important, and this is on a local network, consider UDP.
  9. This one also has the full suite web installer: http://www.ni.com/download/web-based-installer-labview-development-system-2018/7924/en/ and the full driver dvd http://www.ni.com/white-paper/55036/en/
  10. I got back to looking at the code today, I had forgotten but it looks like I did make the object thread-safe. All of the request-response calls are mutexed. For giggles, I spent some time on it today and just pushed a few changes to a fork here: https://github.com/smithed/LabVIEW-Modbus-API I didn't like how my old team did the transaction id fix, so thats one commit. The second commit is to fix the serial thing so the code is no longer nasty. For ascii I added a method to 'read until CRLF' to the network class. For RTU I added a cheat method which tries to guess how big the packet is. If the packet is unknown size, it risks a CRC collision but just polls whatever is at the port. It totally ignores the 3.5 char times nonsense now. I tested all 3 standard pairs on localhost, with the serial ports emulated using com0com. This isn't a perfect representation of real life, but it works ok.
  11. Definitely not crazy, I've seen this a few times before. I'm curious though what happens if you put the indicator on the connpane?
  12. I wasn't the one to do this, but someone here evaluated it and had issues with performance -- it seemed to all be running in a relatively single-threaded way, even on the server. Also, the newer features (alarms, etc) took up a ton of memory compared to what we expected. However performance issues are always tied to a use case -- should be easy to grab an eval and test. Because of the way that OPC UA data models work, the NI server shows up kind of strangely in third party clients. It probably works fine for more advanced tools like kepserver, but I was playing with a fairly low level python client and the representation was weird to me. If you want to use a 3rd party client I'd also grab the eval and test it out.
  13. I find it amazing how convoluted licensing gets..considering thats literally how all money comes in. And I don't say that to pick on JKI -- I say that to pick on a company I saw today which has no less than 7 core software packages, plus for 3 of them you have to buy an add-on for support, plus there are several add-ons compatible with all base versions, plus one specific add-on only compatible with the upper 2 tiers, plus an additional add-on cost per seat which varies based on which base model you selected. It made me ? NI vision is another example -- not quite as bad, but I still have no clue which imaq functions are included with what license.
  14. (2) I think I've mentioned this elsewhere, but its more accurate to say that NIPM has no knowledge of labview. Its simply a system-level package manager, akin to opkg, apt-get, chocolatey, etc. You can make the same source distribution in say, Labview 2015, but since its an OS-level package manager, you have to make a different package for each of Labview 2015, 2016, ..., 2015 x64, ... One comment on that, is if you look at the NI installers, they often just make one package and install the VIs anyway. I only have 2017 installed, and yet I have a labview 2014, 2015, and 2016 folder for whatever reason. So nothing stopping a more lazy package developer to make a single package that deploys the same source distribution to 12 different directories. (3) I believe NIPM can technically do this through a custom XML file, pointing at a simple batch or at cmd.exe: http://www.ni.com/documentation/en/ni-package-manager/latest/manual/instructions-xml-file-packages/#GUID-29BE2213-93C1-4281-8570-7CE1338AEB4A http://www.ni.com/documentation/en/ni-package-manager/latest/manual/assemble-file-package/ (6) Yeah, an otherwise empty package with dependencies is the traditional fix for this (8) Actually this is the part I like better about the NIPM build process -- its much more explicit and it seems easier to me to figure out when stuff goes wrong. Also, a good landing page for NIPM is: https://forums.ni.com/t5/NI-Package-Management/NI-Package-Management-Portal-READ-THIS-FIRST/ta-p/3805952
  15. For a counter argument, ask NI marketing "is DSC dead?" Last time I heard that question they bent over backwards to claim it's not, and yet...
  16. https://github.com/jkisoftware pulled a few of the repos over to github but it doesn't look like any work has been done (the updates shown are just licenses/readmes). I definitely agree with most of those as 'this would be nice' Also, and I realize this is kind of petty...but why green? Why on earth...snowy mint?
  17. I thought it sounded familiar Thats definitely true, I just think that in the case of openg theres no real reason not to merge a lot of them (bool, string, error, comparison, array, data, numeric, time, file) because all of those are basically vilib++. While people might not really want all of them, I doubt many would object to "too much bloat". But to that point, any attempt to modernize openg would have to look hard at whats there. For example, from the error lib: Labview has all of the red items on the palette already, filter error codes is just a for loop around clear errors (from 2014+), and the case structure is...just a case structure with error wires in and out. Personally I use this, although admittedly it took me >5 minutes to find it and I'm the one who wrote it. And this error lib is a dependency of pretty much every other package, because its also a dependency of the string library.
  18. Just for myself, I don't really use openg and never have. I've definitely been using lv for shorter than many on here, so I'm curious if thats part of it (ie lv has picked up the slack over the years) or if its just me. Distributing code that uses it to other people always ends up being annoying. I'd rather write a for loop to remove duplicates from an array than try to explain to some coworker that they need to first install vipm and then look for the specific package and then when it asks to install 17 other dependencies install those too, etc. The for loop is easier.
  19. Link is now dead, they got the feedback I guess. Well, the feedback that this particular install is bad. Not the feedback of "maybe you should test these installers before uploading them" ?
  20. Yeah VIMs are pretty buggy although I'm still back in 17.5. For one particular set (using classes of course) I've had to just convert every instance to static manually, else the exe won't compile. Fortunately I just use them as helpers at the very top level, and drjd's json ones haven't caused any issues.
  21. https://dotnetcademy.net/Learn/4/Pages/1 Its roughly analogous to combination of VI server/scripting + lvoop class loading + variant data type inspection VIs + openg type code inspection VIs...except with a more consistent design His point is just "if you can't call the constructor directly because labview is broken, you can have .net call the constructor manually, by name, using reflection". The direct labview equivalent of what he posted is https://zone.ni.com/reference/en-XX/help/371361P-01/glang/get_lv_class_default_value/
  22. Did they fix your issue here? https://forums.ni.com/t5/LabVIEW/TDMS-Excel-Add-in-18-Crashes-Excel-2013/td-p/3796275 I ended up just removing all of 2018 and reinstalling the driver set because I couldn't make that stupid plugin revert properly (in part because I had NIPM installed)
  23. Yeah, chrome, and I have ublock but its disabled on lava
  24. any ideas why this might be happening? Specifically, everything is bold, regardless of being new or not. I only see this on one computer, but its the same profile (and browser, extensions) on both.
  25. Yes they fixed some of those silly things in more recent versions. Also turning off the call chain on error cluster to code so that RT systems didn't do tons of string manipulation. If I remember his posts correctly shaun uses some ancient version like labview 8.1 or something
×
×
  • Create New...

Important Information

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