Jump to content

GoGators

NI
  • Posts

    75
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by GoGators

  1. Matt Pollock working for NI Sys Eng group did a presentation on JSON RPC in the CLA summit 2 weeks ago.  He showed the beginning of the JSON RPC example.  If we get some more time we can continue to put it together.  Just looked up JSON-WSP.  Essentially SOAP or some other RPC.  That could be cool but would require making an editor for the specification generator.  That could take a while but could be pretty slick.  The nice thing about JSON RPC is pretty simple.

  2. Might I make the suggestion.  For your command/control I have switched to entirely using Web Services.  For streaming of data you can either use the same web service (not really steaming but data on request), or TCP/IP.  I make this suggestion because Web Services offer a lot advantages.  

     

    Advantages:  The absolute biggest one for you is connection management.  In multiuser applications where users can drop in and off a network building a multiconnection management TCP engine can be very tedious.  The web service manages ports and keeps user requests and responses organized for you.  Next you get free security if needed.  It has mechanisms for authentication and encryption.  The last big one is crossplatform.  You won't be locked into using LabVIEW on the client side.  Hell you could even test your application from a web browser.

     

    Disadvantages:  In my testing you can only do 20 requests/sec.  That is for all users.  For command response that typically is not really a limitation.  For polling data off the cRIO it might be.  The amount of data throughput is actually quite high though.  So you can pump many MB of data though the web service.  The second biggest disadvantage is that the LV examples are atrocious.  We're working on that. In fact my team is working on a side project to make JSON-RPC to work.

  3. I assume this is on a real-time target because of where the question was asked.  User events are supported on real-time targets, but I don't use them that often because of the other options of queues and FIFOs. 

     

    What do you mean by adding delay in the execution? I want to tie a PID controller into an event-based messaging framework so it can be configured by and report to other components.

    So you want to have a deterministic loop doing PID, but you want also be able to send commands to it (like setpoint) I assume.  I haven't used execution trace to look at it, but using an event structure is going to make it jittery (don't know by how much).  Personally I have used RT FIFO of type U8 array with the array size fixed to the largest datatype.  The Create RT FIFO has an input where you set the array size.  This will decrease any chance of buffer allocations.  Also I would use the Timed sequence structure.  It puts the loop in a priority thread, but has less overhead than the timed while loop (10% < CPU).

    • Like 1
  4. I was a little confused at first until I relized you were responding to CVT and not CVTWeb addon.  CVT is a concept very similar (if not the same) to what you call Data Pools.  I work on embedded projects mostly, so PLCs typically refer to this data repository as tags.  CVT is definetly not an idea I came up with, as it is more of a concept.  We did focus on speed, usabilty and open source though.

     

      As you described multiple writers makes tags less safe.  Another issue is data coherency.  That is where you can update tags in parallel processes at times that would be less ideal and cause data corruption.  A simple cases is PID control where you update PID (through CVT) in one loop and determinstically process in the other.  If P gets updated and I and D don't before an iteration of control then your going to have a bad time.  We're working on that :)

     

    The real feed back I needed was on CVTWeb in respsct to web interfaces and thin clients.

  5. Hi all.  Since the holidays are coming up I might get a week or two to finish up and publish an open source project I've been working on.  I was hoping to get some feedback before I start writing the documentation.

     

    What:  An web interface to the CVT library AND a thin client for easy system staus updates (diagnostics).  I call it CVTWeb.  If you don't know what CVT is here is a white paper, but it is basically just a map data structure.

     

    How:  The updates to LV2013 web services are really nice so they made it way easier to make this library.  That and some HTML, Javascript, CSS and Twitter's Bootstrap makes up the thinclient.  I was also inspired by this websocket post so I added them incase you wanted to push out from the web service.

     

    TODO:  Install the CVT package below then my Beta version CVTWeb package.  Restart LabVIEW.  Go to Tools->Add CVTWeb Service to Project and that will open up a project with examples.  I tried to script the web service into a selected project, but there is no API for that currently in LabVIEW.  So if you want to add it to your own project you need to drag and drop it.  The example project is read-only so that you don't destroy it.  The examples have instructions in them.  I've tried it on Windows, Pharlap, VxWorks, and NI Linux RT, so it seems to work on all those platforms.

     

    Thanks for the feedback and for those in the US Happy Turkey day.

     

    EDIT:

    Also this is a large effort I'm undergoing to explain how to make thinclients for embedded projects (a topic I find interesting).  I released this article about a month ago explaining the general theory.  Next I'm going to make a walkthrough on making embedded web interfaces.  Then finally I'm going to publish CVTWeb.  Anything else related that someone thinks needs to be addressed.  I can't promise I get to it, but it is good to know.

    ni_lib_cvt-3.3.0.13.vip

    ni_cvt_web_addon-0.1.1.62.vip

  6.  Not something that NI seems all that interested in, which is shame (for us that is)

    Just came across this port.  Sys Eng at NI is interested in zeromq and rabbitmq.  We've been playing around with both and are considered making an open source library if it fits a need.  One of the SEs even built it for the cRIO-9068 platform for alliance day to talk about reuse on NI Linux RT.  Don't count us out yet :)

    • Like 2
  7. I implemented (but don't have the code for right now) a linked list this way and it worked fine, although I found that the only way I could get back to the front of the list was to have a "rewind" method that looped until it reached the start; does the DVR somehow solve this problem?

    Could you post your node class? I am not sure how your linked list solution could move both directions if you just embed the next and previous node directly in the current nodes data. A quick picture and I'll have the 'aha' moment. The DVR is just a crutch for not having a pointer, in a problem that I believe requires one. If the problem was unidirectional (top to bottom traversing) I think dataflow is the way to go.

  8. Yeah that's what I was looking for. I just don't understand what is the type of the children in the TreeNode class.

    Yeah, when I made that it was entirely a workaround. I experimented with a few solutions and that was the one I liked best. Here is a really basic project that shows how to do what you want and it uses properties to make it look less janky.

  9. You need a DVR tree when you need to do bidirectional operations. That is pretty common when you are modeling a real-world system like Marie is. Think of a family tree. Family Tree class contains all the family members. Essentially you traverse the Family tree until you find the family member you are interested. Then you can query who that member's parents, uncles, children are very quickly. This rocks if you need efficent code on a system that you understand well.

  10. I cannot read that document at the moment - NI down again (might have read it in the past though). But from experience, most uses of the NI web server are to make VIs available internally within a company (managers and engineers looking at production etc - Intranet). therefore x-server really isn't an issue. When/if external access is required, usually IT insist that any requests are routed through their main servers anyway, so the browser requests it from a page on the corporate site and the request to the NI web server is sent from the corporate site. So the content seem to come from the same (corporate site) domain as far as the web browser is concerned..

    I'll yield that you know best. I know x-server has gotten me in the past, but I would not call myself a web-savvy developer. More a dabbler.

  11. Easier than you might think.

    Just attach the updateData to a button Onclick event.

    I'm not sure if it is that easy. I am pretty sure the web page must be hosted as a static document in the web service. Most modern browsers (Firefox, Chrome, and maybe IE) prevent cross-server requests, which have the potential to be dangerous. I would start by making a hello world HTML document then staticly adding it by following these directions http://zone.ni.com/reference/en-XX/help/371361G-01/lvhowto/ws_static_content/.

    Then you can use ShaunR's information. If you really want to do an AJAX call simply I would look over jquery library. That is how I learned basic web page development.

  12. * Q's can be used as data structures: FIFO, stack (FILO) -> recursion, SEQ.

    I think those differences come from the fact we have access to both the read/write API of the queue. We only have access to the read portion of the event structure. Using the ActiveX node means we retake the write portion.

    * Events can be used as a one-to-many or many-to-many communication.

    Once again that is because when the event is triggered the writing potion of the event writes to the queues of all the subscribers event queues.

  13. An interesting API was recently discussed with me. Apparently you can use the ActiveX/.NET register event node to register standard LabVIEW UI events (through UI refnum). Why might this be interesting you might ask? Well for a long time I have thought that the deviation between queues/event structure was unneeded. This suspicion was reinforced when the topic came up in the CLA summit. The queue and the event structure have a lot of overlap. The question is should the two implementations be merged?

    I've talked with some who think that the event structure is more data flow oriented, but I am not entirely convinced.

    Just so you can test it, here is some example code I posted to benchmark the callback API (ActiveX/.NET) and the dynamic event mechanism

    CBvsES.zip

  14. Nice discussion. I would like to add that an easy way to determine a decoupled UI and engine would be if you could test the engine without any UI in the first place. If you have an automated test bench for your engine that does not use VI server to generate UI events then you probably have a loosely coupled UI.

  15. Et al,

    I had an opportunity that required me to learn VS Silverlight, which in turn meant I had to learn C#. While I was learning good programming style I came across the Observable pattern and framework classes. Very interesting. For those that don't know it here is the wiki. Here is what I think is the most common use case:

    (1) You have a business model object. The business object is called Observable. The business object consolidates all data that makes up your application into a convenient location.

    (2) Other pieces of you application (typically other objects) will register/unregister with the business object to request updates when the business object gets updated. The objects that register are called Observers.

    (3) When the business object changes the Observers are notified and handed relevant information from the business object.

    (4) The observer takes the relevant info and manipulates it the way it wants.

    The most common use is for UI. Your business object changes and the UI object which has registered to it takes the new data and displays it in an original way outside the knowledge of the business object. The bonus is a very loosely coupled UI and Data.

    Just wondering if anyone has attempted?

  16. Or is there some other way to do this, like just logging in to a service with an ID and a password on the first request.

    Or would it be easier to achieve this goal by using Remote Panels? Thanks.

    cc

    Not sure about what version you are using, but in LV2010 there are ways to assign NI-Auth parameters to each of the web methods. It is in the web services build under the "URL mappings" section. That is by far the easiest. But the browser would have to have silverlight, which the NI-Auth client uses.

  17. Hi Olivier,

    I was the SE that put together the DevZone article Supporting Relational Databases in LabVIEW Realtime. I am glad to see someone making a commercial product out of SQLite. The only reason code exists for VxWorks targets is because an intern needed it for his project before going back to college. I cleaned it up for example purposes.

    I am glad you are supporting Windows and Linux, but it would be very interesting if you also supported real-time targets. As it was previously mentioned, on general purpose OSes, there are typically quite a few options for databases. Although SQLite is light weight and fast, most customers want an enterprise level database connectivity. But when it comes to RT targets, light weight and fast are imperative. That is why SQLite is used heavily in embedded targets (like cell phones), and is very attractive.

    As a side note, I would test your toolkit on a NI Real-time controller running PharLap (any PXI system). PharLap is a stripped out version of Windows, so the toolkit might work as is. Might be another selling point. VxWorks would require you to look at the code in the article.

    Cheers

  18. I think that NI has already developed the IP to take this to the next step. NI needs to make a good business decision here to make an agreement with one or more appopriate tool vendors (could be existing vendors or a new vendor) that will result in a tool that fully supports the latest UML specification and will continue to support future specifications. I think NI can make such an arrangement while benefitting all parties, and I think it will make LabVIEW and NI more competitive as a consequence.

    Not talking from NI VIewpoint (just a lowly Systems Engineer)- That sounds like an Idea Exchange vote. I will +1 you if you put it there. But realistically the user base would have to be huge. Creating programming abstractions is a large task which needs a large use-case in order to be implemented from a business standpoint. Think about the amount of effort that went into Statechart Module.

  19. I've been talking to Jon (jgcode) about LapDog the last couple days. We've both been really busy the last couple months but our schedules are easing up a bit. If you can donate the code to LapDog go ahead and add it to our SourceForge repository. (Create a subdirectory with your logon name under the users folder and drop it in there. We'll copy it into a package-specific directory when we start working on it as a package.)

    Done and done. Never done a source forge project, but luckily I have been using SVN. I think I added it correctly.

×
×
  • Create New...

Important Information

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