-
Posts
4,914 -
Joined
-
Days Won
301
Content Type
Profiles
Forums
Downloads
Gallery
Everything posted by ShaunR
-
Your impression of Brits is rather coloured when you can't even spell 50.
-
Interactive Webpage VI Options
ShaunR replied to hooovahh's topic in Remote Control, Monitoring and the Internet
1. You don't need a client. That's what the browser is. If you want a LabVIEW client, then you need to write one in LabVIEW. If you want a C# one. Then you need to write one in c# etc. Websockets is a protocol! If you do want a LabVIEW client, then here is one that sends the time to the www.websocket.org echo test server. The Open, Read, Write and Close should be a familiar concept. 2. You don't need a web server. With websockets, a web server is sometimes used so that the browser HTML and javascript can be found and downloaded. It isn't a requirement though if the client already has the HTML and Javascript. The web server is a distribution tool for the HTML and JavaScript. Here is a LabVIEW websocket server. You can see it is just a direct replacement for the TCPIP primitives and you use it exactly the same. It supports 1 connection just like it would do if you used the TCPIP primitives. . Here is another websocket server that supports multiple clients. You can download and play with this one here. You can see it uses the primitives to create the server in a producer/consumer fashion just like you would with the TCPIP primitives . There's nothing tremendously complicated here and since the VI services are launched dynamically, you just need to add it to them the the "Always Include" of your build spec. If you use a web server to enable the end user to download the HTML and Javascript rather than supply it, say, as a zip file. The web server still has nothing to do with the websocket communication. Where the toolkits vary is in how they get the HTML and javascript to the clients browser. (which is required only for browsers) Some rely on a web server and if they rely on the NI web server then you need all the deployment malarky. Some pretend they are a webserver and spurt out the webpage on port 80. All that has nothing really to do with websockets just ways of deploying the HTML and Javascript for web browsers. You still have to create/write the HTML and Javascript and some devs are attempting to do that dynamically (like Thomas). So. I will try one more time. What are your concerns with the available toolkits around creating multi client, browser enabled applications. As far as I am aware, they all can but you insist they "fail" -
It doesn't stop me so I expect people in here are acclimatised Guess how many toolkits Mac users buy? Guess how many queries I have had for installing any of my toolkits on Mac? :
-
dynamic content in other web servers
ShaunR replied to smithd's topic in Remote Control, Monitoring and the Internet
Nothing really to say except nice work. I have come to the conclusion that too little rediscovery is sought and many would learn a great deal by doing exercises from first principles like this of technology we all take for granted. -
Easy tiger. He was just being jocular with an expression..
-
Interactive Webpage VI Options
ShaunR replied to hooovahh's topic in Remote Control, Monitoring and the Internet
Hmmm. Extreme A isn't an extreme, IMO. It is what all languages provide when it comes to servers - diddly squat. Servers are applications, not language constructs so you have to write them. Extreme B has been sculpted by your LabVIEW experience and again. I don't see this as an extreme. I don't know of many corporate environments that use the NI webserver. They all want interfaces to their Apache, Nginx, Lighttpd etc. I don't know of a single IT department that I could convince to install the NI webserver, let alone supporting it so I'm not quite sure where to start with this. That aside. Probably the only place the NI webserver is used exclusively is to embedded NI products, so that may be why this particular method is appealing to you The deploy/undeploy capability from the project manager is an abomination in my opinion. I don't want to have a full version of LabVIEW just to install servers. This is before we get to how undocumented and how no NI support is available when interfacing to the project explorer. It's a lot of effort for very little gain with probably you as the increase in sales due to this feature with what? One licence? There is nothing stopping you using one of the toolkits and creating such a deployment method but this is a very subjective requirement based on a particular workflow in one use case. So I am not surprised you don't see this unless you specifically commission someone to do it. But in relation to the available toolkits. I'm not seeing any arguments around issues to create multi client, browser enabled applications. In particular can you expand on: Your terminology concerns me here."Work on the system" implies that you think these toolkits are an IDE extension for multi developer programming environments. This is clearly not anywhere near their remit. -
Over my head. Need help on designing a framework.
ShaunR replied to Mojito's topic in LabVIEW General
Many of us aren't fans of QMH. I'm somewhat ambivalent about them but a couple of points I will make from your description. 1. Future proofing is marketing speak. Adding complexity for something that is not required and just a guess as to future requirements is unproductive, will bite you and adds nothing except complexity. Design your system for the requirements now and iteratively innovate when necessary to encompass new requirements. Experienced engineers will recognise patterns in solutions and code in a way that they know will be easy to modify in the future but the key point there is easy to modify, not seamlessly integrate. 2.If you are going to have multiple consumers of your messages/data then queue based message handling is probably the wrong solution. You will get tied in knots re-transmitting messages/data since queues are a many to one topology and you are trying to create a one to many or many to many architecture. An event based architecture is much more suited to this but you will find very little in the way of formal examples or templates outside of user interfaces. 3. You can have more than one architecture within your program! I see this all the time with even knowledgeable engineers. They choose a magic bullet framework, shoehorn all their code into it and it becomes a mess that only the developer can ever understand and is riddled with bugs. Modular code can have frameworks or architectures at the module or abstraction level and you can mix and match dependant on module requirements (QMH, State Machines, Producer Consumer etc). You can then choose one or more architectures to sew all the modules together to form a cohesive program with defined areas of responsibility that can be debugged in isolation. When new to designing software systems I would suggest the following axiom when using LabVIEW. Design the system top down (from the UI usually) but create the modules/code bottom up. A natural partitioning of code reuse arises from bottom up that is different from the partitioning of responsibilities that top down produces. It is reconciliation of these two partitioning views that yields robust and modular code. So. Enough sermonising Here are some insightful write-ups you may find useful NI QMH Template QMH's Hidden Secret Some Context -
inspect queued events in a compiled application
ShaunR replied to ensegre's topic in Development Environment (IDE)
Correct.- 12 replies
-
- event inspector
- dynamical events
-
(and 1 more)
Tagged with:
-
inspect queued events in a compiled application
ShaunR replied to ensegre's topic in Development Environment (IDE)
If you want a queue. Use a queue primitive. The queue that is used for events is an opaque implementation detail that is part of how Events are realised internally within LabVIEW. If you want a more accurate timestamp, pass it as a parameter. In some of my event systems and even some TCPIP implementations I have a "send" time. You can hook the event with a viewer and logger if you want to analyse your messaging and compare sent and received times. Forget that events have a queue and even forget that they happen to have order on any particular event stack. Certainly don't rely on it - you'll live longer and with more hair.- 12 replies
-
- event inspector
- dynamical events
-
(and 1 more)
Tagged with:
-
Interactive Webpage VI Options
ShaunR replied to hooovahh's topic in Remote Control, Monitoring and the Internet
There are two modes of operation that users typically want. A single application which deals the same data to multiple clients. This is fine for read only interfaces but for bidirectional you have to decide who has control for sending data to it. One client to rule them all otherwise you get config whack-a-mole.. It is the preferred option for resource reasons. An instance for each client which allows each client to control their instance. Each client sees something different and if making them all see the same thing is required, you have to handle it in the software itself (centralised data store) . This is extremely resource intensive and can bring your server to it's knees with enough clients. There are lots of similar projects around the web . With this one, you create plug-in data sources that interface to your back-end. I prefer that model otherwise they would have to define a propriety protocol and dictate comms methods. This way they leave it up to you, which I prefer. There are examples and fairly easy to implement. -
Write to Binary File Cluster Size [x-post to ni forums]
ShaunR replied to GregFreeman's topic in Database and File IO
Yes. If you use the Variant To Flattened String instead you will see the type info on the separate terminal. That won't get rid of the length byte that is prepended to strings though. You will have to process the flattened string and remove that manually. -
Interactive Webpage VI Options
ShaunR replied to hooovahh's topic in Remote Control, Monitoring and the Internet
Sort of the wrong question. It's like saying can my TV pick up satellite? Well. Yes, if you have the right receiver. Can you build browser interfaces to LabVIEW with menus, cursors and sub panel mimic screens with these tool-kits? Many of them, yes. Getting UI information out of LabVIEW into a browser is trivial. Getting the user control requests back in to affect LabVIEW is far more complicated and requires a protocol your specific LabVIEW implementation understands. Is there a wrapper solution that you flip a switch and it is in your web browser? Yes. It's called Remote Panels. I think people see these technologies fundamentally differently to me. I see it as a way to "fix" what NI refuse to do. Maybe I have to address the general need rather than just my own and my customers' for this technology. I see developers being able to view/gather information and configure disparate systems in beautifully designed browser interfaces with streaming real-time data from multiple sensors (internet of things) Interfaces like this but with LabVIEW driving it. Customisable dashboard style interfaces to LabVIEW and interactive templated reporting - all with LabVIEW back ends. You can do this with these toolkits. Most LabVIEW developers, however, just seem to want their crappy LabVIEW panels in a browser frame . That is like being given a house and using it as a shed. -
Interactive Webpage VI Options
ShaunR replied to hooovahh's topic in Remote Control, Monitoring and the Internet
I think it is a good idea to do so. This is detracting from ThomasGutzlers software solution which is an ongoing development and that is getting lost in the general debate. -
Interactive Webpage VI Options
ShaunR replied to hooovahh's topic in Remote Control, Monitoring and the Internet
That just boils down to "I don't know how to do it and I won't pay someone to do it". When you realise that it is just messaging for control and UI updates you end up at a point where you can use any user interface in any language and two main possibilities come out when web browsers are concerned - REST and Websocket Then you start pressurising the IT departments' web developers to stop playing Doom and do something useful . Hooovahhs list is proffered as all products being equivalent. They are not. They just have the common denominator of being able to display a LabVIEW UI in a web browser and demo as such for LabVIEW developers. If your current client server/relies on NI Server remote functions. You are locked in, I'm afraid. If you use messaging, you can create headless, back end services with rich browser interfaces to serve multiple users. -
Fastest way to read-calc-write data with cDAQ
ShaunR replied to volatile's topic in Application Design & Architecture
I presume you are using custom scales so you don't have to calculate inside your code? A quick win over the classic read-then-write for DAQ is to pipeline. If that isn't good enough you may need hardware timed, clocked and routed signals and that will be dependant on the hardware you are using. -
Interactive Webpage VI Options
ShaunR replied to hooovahh's topic in Remote Control, Monitoring and the Internet
If you're giving away free advertising I expect at least a mention -
Interactive Webpage VI Options
ShaunR replied to hooovahh's topic in Remote Control, Monitoring and the Internet
I'm feeling a bit left out -
That sounds more like a virtual function declaration than a callback. LabVIEW supports those less than callbacks . A fully encapsulating C/C++ wrapper for the DLL exposing an initialiser to give a filename is probably the only option here. It sounds like the DLL isn't an API but more like just a compartmentalised piece of code that needs a lot of scaffolding to make anything useful even before you get to interfacing to LabVIEW.
-
Easiest way. Create a buffer (U8 array) when you initialise the DLL event reference. (pass in an already initlaised array of bytes using the Initialise Array.vi). In the callback function; dereference the data and memcopy to the buffer you allocated at init. Then PostLVUserEvent the array. No mutexes required because memcopy is atomic and LabVIEW has its own managed memory copy. You can read the array directly out of the terminal of event structure. There is no way to get out of requiring a C/C++ DLL to do this mediation for you, by the way - LabVIEW cannot create C/C++ callbacks If you can find a .NET version then you can have a VI callback function IF they properly advertise the event, though.
-
You can't create C/C++ callbacks directly in LabVIEW but you can create a DLL or wrap an existing DLL that registers for the callback and generates a LabVIEW event.
-
I was meaning using the control label like the following so it uses the same semantics as the event primitives.. The only reason I had a text control with the name in the text was because the VIM wouldn't transfer the label name inside it's macro so I couldn't read it. Otherwise I would have done so. You can do this with Xnodes though I think. Hint: Use messages "UI>MOTION>SET POSITION>x,%.3f", "UI>MOTION>SET POSITION>y,%.3f", "UI>MOTION>SET POSITION>z,%.3f" and have one "MOTION" service instead of having 3 actors.
-
Version 0.2
284 downloads
This is an experimental demo to investigate VIMs (vi macros). It was a bit of fun to see if VIMs could be used to encapsulate events in LabVIEW which was a bugbear of mine for quite some time. You can see the entire thread here. VIMs are a NI experimental technology similar to Xnodes but less mature. The purpose of this release is to clarify the previously unstated licence since other forum topics are building on the original demo so they need a permissive licence (MIT). This release serves as an unambiguous statement to that effect. There are a few differences from the original which I have decided to call version 0.1 but they are minor. Note: This may or may not work for you out of the box. If it doesn't then please do not post. The purpose is to clarify the licence for others to build upon; not to provide a working example. The VIM technology is itself experimental and unsupported by NI so most issues you will encounter will be due to this and It is unlikely there will be another version posted here. -
Name: VIM HAL Demo Submitter: ShaunR Submitted: 25 Sep 2015 Category: *Uncertified* LabVIEW Version: 2009License Type: MIT This is an experimental demo to investigate VIMs (vi macros). It was a bit of fun to see if VIMs could be used to encapsulate events in LabVIEW which was a bugbear of mine for quite some time. You can see the entire thread here. VIMs are a NI experimental technology similar to Xnodes but less mature. The purpose of this release is to clarify the previously unstated licence since other forum topics are building on the original demo so they need a permissive licence (MIT). This release serves as an unambiguous statement to that effect. There are a few differences from the original which I have decided to call version 0.1 but they are minor. Note: This may or may not work for you out of the box. If it doesn't then please do not post. The purpose is to clarify the licence for others to build upon; not to provide a working example. The VIM technology is itself experimental and unsupported by NI so most issues you will encounter will be due to this and It is unlikely there will be another version posted here. Click here to download this file
-
Sounds good. I'm not really suprised you are having these difficulties. When you consider others talking about identifying which features are available in which LabVIEW versions, you know backwards compatibility is broken..So far, no-one has revealed what the common sets are, preferring to play with the latest and greatest. With your multiple axis motion controller; I disagree. In the service model you would just have a Motion Controller Service and send it X, Y and Z commands or more likely "TABLE>MOVE>PRESET1" or similar. There should be no reason why you cannot have multiple versions of the same type unless I'm missing something. Only the name string is important and that is derived from the constant label (this is how queues work after all).. The constant's name should dictate the event name, not the data type Even if you do name them the same it is basically a no-op for whichever call gets there second. The events are global so two events with different data-types that have the same name is not desirable or needed and would have so many caveats as to make them unusable, IMO. So I'm not really sure what issue you are trying to solve by adding the terminal back in. That just seems to be the motto for Xnodes A good improvement on the last one, though. Before, It had the same problems as the VIM and then some. It worked out of the box this time for me so thats great.
-
Should File IO be handled by a central actor?
ShaunR replied to AlexA's topic in Database and File IO
I think you are probably looking at it slightly awkwardly. You went for compartmentalised solution according to some best practice ideology and then found it got awkward for concurrent processes. You want it to be easy to manage and scalable, and the way you did it was exactly that, but the downside was creating bottlenecks for your asynchronous processes. You have the SOUND.vi problem whereby I needed to be able to play arbitrary asynchronous WAV files simultaneously when a single sound could be 10s of seconds. If the SOUND.vi could only process one message at a time that was useful but I wanted a more generic solution. Sol. I made SOUND.vi a service controller.Other processes ask it to "PLAY"a particular file. It then launches a sub process for that file and returns immediately having no more involvement in the data transfer. How could this work with, say, TDMS? You have the FILE service. You send it a message like FILE>STREAM>TDMS>myfile[.tdms]. The FILE service launches a listener that is registered for "myfile" messages. You tell the DAQ service to launch an acquisition - DAQ>STREAM>AI1>myfile. or similar And that's it! The DAQ pumps out messages with the label "myfile" and the listener(s) consume them. Of course the corollary is you can use "FILE>STREAM>TEXT", "FILE>STREAM>BIN" etc, even at the same time .and you still have your FILE>WRITE and FILE>READ which you don;t really have to launch as sub processes. You've started a producer and consumer and connected their messaging pipes. You can do that as many times as you like and let them trundle on in the background. Your other "plugins" just need to send the right messages and listen in on the conversation (also register for myfile).