Using a 2-D array Single Process Shared Variable w/ RT FIFO for comm between a Deterministic and non-deterministic loop on an RT Target

Our problem is that we currently use a 2D array to store CAN data on a Real-time Target. The array is 20 elements of 3 byte elements as so:
                0              1              2
0              [byte]   [byte]   [byte]
19           [byte]   [byte]   [byte]
These values are passed between a Deterministic Timed (DT) loop where they are set and a Non-Deterministic Timed (NDT) loop where they are read and passed into a Network Published Shared Variable (NPSV) for communication across the network to a Host PC. I have insrted an image for illustration, pardon the size.
Currently to pass the data between the DT and NDT loop we are using a Global Variable (GV). To improve the system we have attempted to replace these GVs with Single Process Shared Variables (SPSV) with an RT FIFO enabled.
To create the shared variable I simply right clicked the GV of interest and selected create Shared Variable Node form the drop downs. At this point LabVIEW presented me with a 2D NPSV within a new Library hosted on the RT Target. I then selected this new NPSV from the Project, changed it to a SPSV, and enabled a single element FIFO. This variable was initialized with a default value for the size described above and then used in our code for the DT to NDT communication, and conversion to a corresponding NPSV for sending to the Host.
When I went to run the code I noticed that the variable was in fact 2D, however its size was only 2 elements of three bytes each, in other words only two of the row indices were populated and the other appeared as uninitialized. in addition, this data had no resemblance to the set initilazation value. This was also how the variable was presented on the host side of the network after tranfer into a NPSV.
The peculiar part is that If I change this SPSV to a NPSV and then try to change it back, I receive an error saying the type is not supported for SPSV with an RT FIFO enabled. I have to disable the FIFO (which defeats the entire purpose) in order to successfully compile! I am unclear as to what is the bug in this case. Should I not be allowed to create the original 2D SPSV with a single element RT FIFO enabled without receiving an error? Or if this is okay how do I fix the problems associated with the variable after being allowed to create it?
I have found the following discussion in which a user states “The only limitations for custom controls is the ability to use it with RT FIFO enabled on a network-published shared variable”. Is this also true for SPSV? I have not found any documentation explicitely stating this for SPSV, though it is stated for the NPSVs.

Martin,
RT FIFOs don't support Multi-Dimensional Arrays, which would corroborate the issues you're seeing.  You can break up the 2D array into 1D arrays by reshaping the array, then you'll be able to use the RT FIFO enabled variable, just set the array size to the total number of elements (20*3 = 60).
You can also pass the 2D array via pre-allocated queue, or using a Functional Global.  We have a reference example for a circular buffer using Functional Globals here.

Similar Messages

  • Why do Single-Process shared variables create a single variable VI in my dir.

    I'm creating an application VI following the example which is created by starting a two loop Real-Time project which creates a Single-Process shared variable and a Network-Published shared variable for each variable that needs to be sent to a non-Realtime host VI. Each of the Single-Process variables shows up as a VI file with the following format: <variable library>_<variable name>.vi. The VI has one control which is the shared variable. I have a large number of variables and this creates a lot of clutter in the directory. I expected them to be rolled up into the library file. Is this expected behavior? I'm attaching a screen shot to show the behavior.
    Attachments:
    Shared Variables in Directory.JPG ‏383 KB

    Hi davidreed10,
    This is a known issue with single process variables that are saved in a
    project that has the .lvproj and .lvlib files initially saved in different
    locations, as is the case with Real-Time projects. This has been
    previously reported to our R&D department with the ID #56580, and
    is being worked on for a fix in a future release of LabVIEW.
    This should be only a problem for Single-Process variables, and not
    Network-Published variables, so if you want to keep your folder from
    getting cluttered up, changing the variable types to Network-Published
    should get you around the problem for now.
    Regards,
    Stephen S.
    National Instruments
    Applications Engineering

  • DSC - Event triggering for Single Process Shared Variables

    Hello,
    I understand how to set up a Value Change Notification for Network Published Shared Variables so that an event will trigger when that particular Shared Variable changes. However, I can't figure out how to do the same for Single Process Shared Variables. Is this even possible? Can someone shine a light on this, please?
    Thanks in advance.
    - James Pham
    Solved!
    Go to Solution.

    VRspace4,
    Hello! It is not possible to enable alarming for Single Process Shared Variables. A workaround to setup a Value Change Notification would be to create a network shared variable that reads from your Single Process Variable, but at that point in time it might be worth just replacing your variable with a networked shared variable.
    Ben Sisney
    FlexRIO V&V Engineer
    National Instruments

  • Issues with Shared Variables in Systems Running for Extended Periods of Time

    I am designing a large SCADA system using LabVIEW DSC and cRIOs. My plan is to use shared variables to communicate the majority of the information across my network (much like "tags" in a normal SCADA system).
    I'm wondering if anyone has experienced issues (connection failures, etc...) with shared variables running on systems for months (both real-time and windows based PCs) without the cRIO or PC being restarted/redeploying the variables. What is the stability of the Shared Variable Engine over extended periods of time?
    Thank you for the input.
    --CLD--
    LV 6.1, 8.6.1, 2011 SP1, 2012 SP1

    I have a system with 2 cRIO's each with Ethercat extension chassis.  Each cRIO hosts ~100 NSV's and is running the scan engine at 40 Hz.
    Each cRIO is coupled to a HMI that has front panel control bindings to NSV's hosted on the cRIO as well as a windows hosted mirror library (used for citadel db logging) that is also bound to the cRIO NSV library.  The cRIO's have monay months of contiguous run time without reboot and I closely monitor cpu and memory usage and also rt performance metrics and will log faults if there are any such events.  I also use NSV's for messaging from the HMI to the cRIO for such things as setting zero offset values and deploying configuration parameters.  My overall findings are that the SV engine and the PSP are stable and efficient (especially NSV<->NSV and NSV<->HMI binding)

  • Do I need to set host side shared variables to RT FIFO?

    Hello there,
    in my application a LV host application communicates with compact RIO through shared variables. On cRIO i have some shared vars with RT FIFO enabled. On host side for those vars which are bound to cRIO i did the same. Is that neccessary?
    In general I am confused about shared variable settings on both sides, for example when I want network buffering. Do I set buffering on RT side or on PC side or on both, what is the difference?
    regards
    Thomas

    Dear Thomas,
    thank you so much for your post. The shared variable with RT FIFO enabled works the same as the RT FIFO functions on the RT functions palette. The RT FIFO is for communication between the higher priority loop and the normal priority loop. You can see it like this; if the shared variable with RT Fifo enabled is network published there is a communication loop (hidden) which publishes the shared variable to the network port of the cRIO system. The RT FIFO option is only for the communication between your high priority loop and this hidden loop. The hidden loop is executed when the higher priority loop is idle. Again I speak about hidden loop just to create a clear picture.
    So for your PC side no RT FIFO is needed. Please notice that by using shared variables you can lose data; for example the cRIO publishes the data faster then your PC can read the data; you will lose data points. Shared variables are based on UDB, you can see it like a radio station which is transmitting. It doesn't matter if people are listing to the radio station. Use the TCP functions (for example theSTM library ) or the network stream API if you don't want to lose data.
    Please let me know if you have any further questions,
    Best regards,
    Martijn S
    Applications Engineer
    NI Netherlands

  • Find the key for join between table "crhd" and "equi" for use field "answt"

    I make program for read data from table "crhd" for print  about machine report
    but I can not find the key for link join to table "equi" for print field "answt" (acquistion value)
    please help me  find the key field for join between table "crhd" and "equi" for use field "answt"
    thank you very much...

    This is how the Work Center is linked to a particular Equipment -
    Functional - In IE03 ( view Equipments) You see the Work Center of a particular Equipment.
    Technical - Go to view V_EQUI ( view of EQUI and EQUZ). Pass the Equipment number alongwith V_EQUI-PM_OBJTY = 'A' ( i,.e searching for the Object Type Work Center).  In this way u ll get the V_EQUI-GEWRK - this is the Work Center ID.
    You can pass this Work Center ID to CRHD. And you will get the Work Center text.
    CRHD-OBJTY = 'A'
    CRHD-OBJID = V_EQUI-GEWRK.
    and u ll get the CRHD-ARBPL - this is the Work Center.
    So u need to come backwards, alongwith ur CRHD-OBJTY and CRHD-OBJID , you pass the same to V_EQUI and u get the list of equipment numbers alongwith ur ANSWT(Acquisition value).
    I guess it solves ur problem.

  • Using multiple EIM tables in single process section

    Hi ,
    Often we come across a situation where in some required columns are mapped in one EIM table and some mapped in the other EIM table mapped to a given base table.
    Is there a way wherein we can utilize multiple EIM table having mapping of a base table under the same process section with only base table parameter poiting to the target table.?
    Regards,
    Ashutosh

    Hi,
    May be I have misinterpreted what has been mentioned in the EIM admin guide.In the page 41 chapter EIM Configuration File the following has been mentioned for the TABLE paramter.Therefore i was wondering if we can use more than one table in a given process section in IFB file.
    [TABLE           Required. Specifies the name of an EIM table used in this process.
                         *Multiple TABLE parameters may be used to define a process using*
                         *more than one table*.
                         Example:
                         TYPE = EXPORT
                         BATCH = 101
                         TABLE = EIM_ACCOUNT
                         EXPORT MATCHES = S_ORG_EXT, (NAME > ‘A’)
    NOTE: For performance reasons, you should limit the number of
    tables to export or merge in a single process section to five tables or
    fewer.]
    Warm Regards,
    Ashutosh

  • Tables used for relationship between BP customer and BP Sales employee

    Can annybody tell me what tables contain the relationship between customers and sales employee.
    Or what tables are used by the BDOC BUPA_REL ?
    Thanks for your input.

    In table BUT050 you can find relationships between business partners.

  • Shared Variables - Properties

    Hello,
    I have a couple of questions about properties of Shared Variables (SV). They can be configured either by using the dialog box (right-click on SV -> Properties), or programmatically via the "SharedVariableIO" property node. Have a look at the NI-Examples to see how SV can be created programmatically by using the DSC module.
    1)  The dialog box offers a property "Variable Type" which can be "Network-published", "Single-Process" or "Time-Triggered". The "SharedVariableIO" property node gives no access to this property. Does anybody know why? The same question can be rephrased: How can I create a "Single-Process" SV programmatically?
    2) The "SharedVariableIO" property node has two items, "Network.OnScan" and "Network.ConnectionType", which have no direct correspondance to any of the properties available in the dialog box. What is the exact meaning of those properties? The on-line help isn't of much use here...
    3) Mutliple SV can be edited by using the Multiple Variable Editor (Tools->Shared Varaible->Multiple Variable Editor). A cool feature is the import/export of CSV-files. I am interested in programmatically creating SVs from the information stored in such a CSV-file. Reading the file is no problem, but connecting the file entries to the properties of the "SharedVariableIO" property node would be quite some job. In principle NI has already solved that within the Multiple Variable Editor. I guess there is a bunch of VIs somewhere below "....Program Files/NI/.../vi.lib that do exactly this thing. Does anybody know, if these (which ones?) are available for public use?
    Regards,
       Dietrich

    dietrich wrote:
    1)  The dialog box offers a property "Variable Type" which can be "Network-published", "Single-Process" or "Time-Triggered". The "SharedVariableIO" property node gives no access to this property. Does anybody know why? The same question can be rephrased: How can I create a "Single-Process" SV programmatically?
    You can't.  The single-process shared variable is an old style LabVIEW global placed under the shared variable abstraction.  There is currently no way to create those on the fly.  Time-triggered also cannot be created programmatically.  I confess I don't know enough about them to know the reason why.
    dietrich wrote:
    2) The "SharedVariableIO" property node has two items, "Network.OnScan" and "Network.ConnectionType", which have no direct correspondance to any of the properties available in the dialog box. What is the exact meaning of those properties? The on-line help isn't of much use here...
    Network.On Scan = read/write hardware? - this allows you to programmatically control when you are reading from or writing to configured hardware.
    Network.ConnectionType = connect to hardware even when no one is viewing me? - this has 2 choices, UpFront & OnDemand, UpFront means that the variable will be connected to hardware even when no one is connected to the variable.  This is useful when you want to reserve hardware or when logging is enabled.  OnDemand means that you disconnect from hardware whenever no one is reading the variable.
    dietrich wrote:
    3) Mutliple SV can be edited by using the Multiple Variable Editor (Tools->Shared Varaible->Multiple Variable Editor). A cool feature is the import/export of CSV-files. I am interested in programmatically creating SVs from the information stored in such a CSV-file. Reading the file is no problem, but connecting the file entries to the properties of the "SharedVariableIO" property node would be quite some job. In principle NI has already solved that within the Multiple Variable Editor. I guess there is a bunch of VIs somewhere below "....Program Files/NI/.../vi.lib that do exactly this thing. Does anybody know, if these (which ones?) are available for public use?
    I would advise against using any of these.  National Instruments can change, or remove, those underlying files at any time as a result of modifications to the MVE.  That could cause issues for any code using those sub-VIs.
    Regards,
    Robert

  • Changing shared variable reference modes for all nodes in applicatio​n. Shortcut?

    I have a large application which makes extensive use of both network-published and single-process shared variables.  I want to change the reference mode of every such node in the application from absolute to target-relative.  Is there any way to do this without having to open every subVI in the application and use the right-click menu on every node?
    Sean

    I don't know of any shortcut, but if you want to change the reference node of everything in the application you could probably script it.  I was thinking something similar to what I have below where you traverse the BD of a specific VI for all SharedVariableNodes and change the relative mode to Target Relative.
    Depending on how your project is organized you can add some additional functionality before the open VI reference to go through and open the reference of every VI in your project.
    Matt J
    Professional Googler and Kudo Addict
    National Instruments

  • Shared Variables vs Globals

       I started a large project recently and decided to make use of Shared Variables.  :I need some network communication between LV apps, so that is the main reason, but I decided to put them to the test by also using single-process Shared Variables instead of globals.  (Yeah, yeah, globals are evil.  blah blah blah.  I'm not really interested in dogma here.  Suffice it to say that, IMHO, there are still a few times and places where globals are appropriate and useful.)
       My project is fairly modular, and the main control program launches numerous other top-level programs.  The problem is that whenever one of these top--level programs (or the main program) is launched, the Shared Variable deployment window pops up and does its several second initialization.;  If this happened just once, when the top level program launched, it would probably be acceptable.  But having each dynamic VI go through this gets annoying.
       I'm using 8.2.1.  I haven't tried 8.5 much yet, but at least in 8.0 and 8.2, you can't search for Shared Variables.  That is also annoying and can lead to maintenance issues.
       So now I am considering replacing all the single-process Shared Variables with good-ole Globals.  A couple of the VIs in the system will still use networked Shared Variables, so they will still cause the deployment window to pop up, but it will be much less frequent.  And I'll be able to search for the globals and make sure I'm using them responsibly.
       Does anyone have any other ideas on how to minimize the deployment window?  Or ideas on development patterns using Shared Variables?  Preferences for Shared Variables vs Globals?
    Thanks,
        Dave
    David Thomson Original Code Consulting
    www.originalcode.com
    National Instruments Alliance Program Member
    Certified LabVIEW Architect
    There are 10 kinds of people: those who understand binary, and those who don't.

    Ben,
       Wow, you are quick.  And thanks.  Good catch.  Turning off the auto-deploy removes the dialog.  Nice, but now I have to figure out how the SV's are going to get deployed on each installation...  I haven't fully digested how SV's really work, especially how to best handle the deployment issues.  This project will be installed on a number of computersand used by scientists, not LV programmers.  So I need a reliable way of setting up the deployment.  Perhaps it is just one more step in the installation process..  That assumes that all the SV's are defined when the program is first installed  The program is very modular, so the end-user will be able to copy new modules into a certain directory and be able to use them right off the bat, no extra programming.  But if a new module contained a new SV, it wouldn't be deployed...
       Any suggestions for searching?  I haven't tried it yet, but it seems that deleting a SV from the project is the only way.  That causes an error to occur at each instance of the SV.  Assuming all the project VIs are in memory, you can then use the error finding to locate every instance of where the SV was.  Of course, it isn't there anymore.  Minor issue...
    Graziano,
       Thanks for the ideas.  I do use functional globals a lot as well.  Very nice tools.
       I was really trying to transition to SV's so that I could use the Networked version.  I was using Single Process SV's instead of globals just as an experiment and to potentially leverage other SV features for them in the future.
    Regards,
       Dave
    David Thomson Original Code Consulting
    www.originalcode.com
    National Instruments Alliance Program Member
    Certified LabVIEW Architect
    There are 10 kinds of people: those who understand binary, and those who don't.

  • Why string arrays not allow in shared variables?

    I'm changing a program to replace some global variables with shared variables.  The need for an executable is the reason the globals are being replaced with SV's.  At least one of the variables is a 2 diminsion array of strings.  Under the 'data type' drop down list on the shared variable properties there is no option for an array of strings among the 28 posibilities.  Any way this can be accomplished?  I'm using version 8.0
    thanks, Mike

    Nick, I am attempting your solution.  I upgraded to 8.5, created a custom control as a 2 diminsional array and made it a shared variable.  it works fine in uncompiled mode but when the programs are made executables the array info is not passed.  Now I have to say I find the whole compile process with Labview pretty confusing so I'm guessing I'm doing something wrong in that procedure or I am simply misunderstanding this whole data passing concept on some fundemental level. .  I have attempted several different compile property setting under the "Source Files" page.  Both the write and read programs are in one project along with the custom control and the shared variable.  I compile two applications using the write and read vi's as startup files and have included the custom control and the shared variable in the "always included" area.  I've tried including the last two files or not including them in the compile and it makes no difference.  Setting the variable as 'single process or  'network published'  makes no difference either.   
    Attachments:
    controlrw.lvproj ‏9 KB

  • Use of Shared Variables for data transfer from a RT traget to a desktop application

    Hi,
    I want to adopt the shared variables to share data in an existing distributed application comparable with the T3 Benchmark configuration in this document:
    [1] http://zone.ni.com/devzone/conceptd.nsf/webmain/5B4C3CC1B2AD10BA862570F2007569EF
    The current implementation uses a well tuned solution with RT FIFOs and TCP/IP communication with a desktop-PC which monitors and stores the data.
    The desktop application runs with a much slower execution rate than the TCL. So the TCP/IP packets are used to buffer the data with a package size dependent on the data send rate.
    To use the shared variables instead of this RT FIFO + TCP/IP implementation I need to read the shared vairable buffer at once each time the desktop application reads the shared variable.
    But according to this quotation from [1]:
    "With buffering, you can account for temporary fluctuations between read/write rates of a variable. Readers that occasionally read a variable slower than the writer can miss some updates."
    this seems to be impossible. Am I right?
    Are there any suggestions to circumvent this problem? Or are shared variables not made to share data between unsynchronized processes without data loss?
    Regards Till

    You can use the error-cluster to detect the end of your queue. The erroroutput of the shared variable will return a -2220 Warning, if it reads a value it has read already before. I attached a modified example and saved it for 8.2 I hope you can open it.
    Attachments:
    readbuffered82.zip ‏51 KB

  • Single Processing for CCTR entity type

    Hi
    I want to create cost center using single processing .
    Steps followed for this as below
    Create Blank CR with CR Type OG_S003 (With Entity Type CCTR) with deselected single processing check box under  Create Change Request link. CR is created for entity type CCTR and CR Type as OG_S003.
    Try to create cost center under Single processing by selecting Entity Type Cost Center,Proper Edition,Controlling Area and Cost Center value to be created it fives me error as no change request assigned to you.
    Here my question is there is already CR for cost center then why SAP gives me error?
    When I  try to create Blank CR with CR Type OG_W003 (With Entity Type CCTR) with selected single processing check box under Create Change Request link.it gives me error at step no 3 ' 500 SAP Internal Error'
    Is I am missing something?
    I can able to create CC with same CR created as mentioned in point no 1 with cost center group as entity type but not for Cost Center as entity type.
    Can anybody explain SAP logic behind this?

    Hi Kiran
    But when I try to create CR with CR TYPE OG_W003 under Link Create Change Request Type it gives me error at stage 3 (Changes) as per below
    500 SAP Internal Server Error
    ERROR: An exception has occurred
    (termination: RABAX_STATE)
    When I try with link Single Processing it gives me below error
    No change request is assigned to you

  • Strange behaviour with Vision 8.2 and Shared Variable 1D Image Array

    I've just upgraded to LabVIEW 8.2 and Vision 8.2.  When loading a particular VI, it is searching numerous times for ...\LabVIEW 8.2\resource\objmgr\IMAQ Image.ctl - which of course doesn't exist.  As best as I can track it down, this seems to be cause by a Shared Variable I have in the project which is a custom control of a 1D array of Image. 
    So I've created a new project from scratch to illustrate (attached).  The VI runs OK, but any editing means that this non-existant control is searched for again.  Of interest is also that there is a coercion dot where the Image is used, but the data type on the wire seems OK.  Creating a control (rather than a Shared Variable) works fine.
    Anyone know what's going on here?
    Message Edited by GregS on 02-26-2007 03:43 PM
    Attachments:
    1DImage.png ‏4 KB
    1DImageShared.zip ‏15 KB

    Hello Greg,
    I downloaded your project and opened it up on my
    system.  I received the same results as you
    did – I tried to open the project it searched for \LabVIEW 8.2\resource\objmgr\IMAQ Image.ctl.  I also used the 1d Image.ctl file as a constant on my block diagram and it did not
    show the coercion dot as you mentioned.
    There does seem to be some strange behavior going on here
    with the coercion dot and the shared variable. 
    I will have to look further into it and report this to R&D. 
    But for now, we need to address your application.  What is the goal of your application?  How does using a shared variable with IMAQ
    Images help you get there?  You may be
    aware of this already, but when an Image wire is passed around LabVIEW, it is
    not actually passing a copy of the data in a dataflow manner.  The large size of IMAQ Images necessitates
    that LabVIEW pass around a pointer to the IMAQ Image.  Therefore, when an array of Image controls is
    made and used as a shared variable, the controls do not contain the actual
    image data.  Instead, they contain
    pointers to the IMAQ Images.  When they
    are passed into a shared variable, unexpected results may occur.  If the shared variable is network published,
    for example, another computer on the network would receive a pointer to an
    image that it would not be able to find or access.
    There may be a much better way than shared variables to
    achieve the same functionality you are currently looking for.  If you do in fact require shared variables,
    you could use IMAQ ImageToArray.vi
    to create an array that can be used in the shared variable like any other data
    type, and then use IMAQ ArrayToImage.vi
    on the other end to be able to view the array as an image.
    Please post back with more information about your
    application and we should be able to find the best solution for you.
    Regards,
    Luke H

Maybe you are looking for

  • Compatibility captivate and IPad, help

    I need to know with certainty if adobe captivate is compatible with IPad. I have a problem with Storyline who registers in the librairy the course, the course his accessible even the transfer of the course is ended. It is a big problem for my custome

  • Check on Shop for usrid and Goods recipient field in BADI

    I would like to make a check thro' check docuement BADI in SRM 3.0, Give an error to user if shop for usrid is different from Goods recipient field in the shopping cart. In which structure the shop for usrid information is stored and how should I rea

  • How to use connec with java 6.0 ?

    I often use the function below to connect Database:      public Connection getConnection(){ try{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); conn=DriverManager.getConnection("jdbc:odbc:EmployeeManagerDB","sa","sa"); System.out.println("Get connect

  • Generating a pulse sequence in NI5401 board

    Sirs, I?m sending this email massage because I have a doubt concerning NI 5401 Function Generator Board. I?m working with a PXI system together with a NI5401 board, and I want to generate a pulse sequence with this board. The propose of this is to sy

  • IMac wireless mouse Can not right clip to open attachments in Outlook E-mail attachments How do I overcome this

    I have a new iMac great system - has Lion - I have a web based e-mail through Outlook that has attachments that I need to open - I receive a note that says right click to download - this wireless mouse does not have buttoms so I click on where I thin