Debug shared variable array

I am passing data between a PXI RT Target to a PC Host using Shared Variables.  Everything passes correctly between the Host and the Target, but Shared Variables that are arrays do not pass between the Target and the Host.  Single elements whether boolean, numeric, or string pass from Target to Host with no problem.  I use NI Distribution Manager to examine Shared Variables.  How can you find the content of a Shared Variable that is an array, without writing my own VI? 

This tool doesn't give me any more information than the Dist Sys Mgr.  The SVs that are working show quality "good" vs "no know value" for the SVs that are not working.
My network-published SVs are single-writer 1D arrays (U32/SGL) of varying sizes (64-1005). 
When I write to the SV I get error -2147024891 with the source being \\My Computer\Lib\mySV\\xxx.xxx.xxx.xxx\Lib\mySV where xxx.xxx.xxx.xxx. is the IP address of My Computer. 
When I read the SV I get warning -1950679044with the source being \\My Computer\Lib\mySV\\xxx.xxx.xxx.xxx\Lib\mySV where xxx.xxx.xxx.xxx. is the IP address of My Computer.  I get this warning when I'm reading the SV either from the target or the host.
I've checked the properties pages for the SVs and I don't see how LabVIEW is interpreting the network path twice.  What could be causing this?
Also, if I delete a SV from my library of SVs it still shows up in the Dist Sys Mgr until I restart LabVIEW.  Why?

Similar Messages

  • Error Reading a Shared Variable Array

    Hi,
    I am having a problem reading an array of 20 unsigned integers from an Allen Bradley ControlLogix PLC with Labview.
    I have set up a shared variable for this purpose.  I have set the Data Type of the shared variable to ArrayOf Unit16.  The Variable Type is Network-Published, and I have check the Bind To Source checkbox.  I think my problem is in the shared variable path.  I have tried the following with no success:
    MyComputer\ControlLogixTags.lvlib\RsLinx\ProjectX\Online\Faults\Faults
    MyComputer\ControlLogixTags.lvlib\RsLinx\ProjectX\Online\Faults\Faults[0]
    MyComputer\ControlLogixTags.lvlib\RsLinx\ProjectX\Online\Faults\Faults[]
    MyComputer\ControlLogixTags.lvlib\RsLinx\ProjectX\Online\Faults\
    MyComputer\ControlLogixTags.lvlib\RsLinx\ProjectX\Online\Faults
    I have created a simple vi for testing.  I have wired the shared variable to an indicator which is an array of UInt16 items.  When I run the vi, I get an error which says "Error 91 occurred at Variant to Data in Text.vi.  Possbile Reason:  The data type of the variant is not compatible with the data type of the input."
    Does anyone have a suggestion as to what I am doing wrong?
    Thanks in advance for your help,
    Phil

    Phil,
    In order to determine that you can correctly communicate with your OPC server, I would suggest creating a shared variable bound to a single tag. It sounds as if you already have an RSLinx I/O Server in your project library. Now you can create a new shared variable and use the browse option to browse the items of your I/O server. Be sure to select a tag that has a known value such that you can verify successful communication.
    Also, does your VI utilize a dynamic data conversion? The error code mentioned (error 91) is normally associated with this data type. Our next step will be to look at this VI once we can establish successful communication. I hope this was useful for you. Please let me know if I can be of further assistance.
    Mike
    National Instruments
    Applications Engineer

  • Data Logging a programmatically created shared variable of cluster or array datatype into citadel DB

    Hi,
    Is there a way to log a programmatically created shared variable of cluster or array datatype into citadel DB?
    I have attempted to programmatically create a shared variable of type 'double' and was able to successfully log the same into Citadel DB. In the attachment, Please refer to the attached project SV_TC.lvproj and specifically to SV_W.vi for the code that i have used (W.png file shows the dB in MAX and shared variable in NI Distributed System Manager)
    However when i tried the same approach to create a shared variable 'array of double', i noticed that traces are not getting created and hence data logging isn't happening into the Citadel DB. I was however able to write and read the shared variable array without issues. The same is true with cluster datatype also. Please refer to SN_NW.vi for the code that i have used - only difference from SV_W.vi is that i have tried to create a shared variable of type 'array of double'
    One observation is that if i create an 'array of double' or cluster in a shared variable library using the project explorer and deploy, i could see that these being logged into Citadel DB.
    Hence i want to understand what could be done to achieve the same programmatically? Could you please advice?
    Regards,
    Sridhar
    Attachments:
    SV_TC.zip ‏3925 KB

    Why is the transaction happening over remote?
    Because we need the information to be on our database immediately when they submit it.
    I don't know anything about streams or replication.....
    The web database is run by the company that hosts our web site. We use PL/SQL to show the pages and output the html. It fetches the data the customer is requesting from our database, but I'm struggling to get the best way to insert into our database from there.

  • Shared variable dataflow

    Hello all,
    I am using a shared variable to share a 2D array of SGL datapoints between two networked PCs:
    PC-1 has the shared variable setup in the project as a Network-published variable using Buffering (size = 1 array, Array size = 20 elements).
    PC-2 reads the shared variable using an array indicated with data binding to (PC-1).  A colleague put the shared variable in a flat sequence with a wait state.  I couldn't see any reason why this would work, so I removed the flat sequence.  After that, I found that sometimes the array will be empty when it should have valid data.  I put the flat sequence back and viola!, the program works normally. 
    Attached is a code snippet from PC-2 where the issue happens. ('Data' is the shared variable array').  Any ideas?
    Message Edited by vt92 on 04-02-2008 10:04 AM
    "There is a God shaped vacuum in the heart of every man which cannot be filled by any created thing, but only by God, the Creator, made known through Jesus." - Blaise Pascal
    Attachments:
    no_joke1.gif ‏6 KB

    Look like you have a race condition occurring. He probably extracts the data and waits for a 100 ms to have the next data ready. When you removed the sequence, you the 100 ms not occurrs concurrently and will be a bit shorter. The process writing to the data may not be fast enough to get the data ready for the next operation. or loop thus getting false data or the process has not completed to put the data in. the sequence guarantees, that you wait 100 ms to occur after the data read, whereas when you removed it, it can be any time within the 100 ms.

  • Bind shared variable to multi-chan​nel item

    How do i bind a shared variable (array) to a Fieldpoint multi-channel item?
    When i configure the shared variable, and click browse to select the network item to bind to, i can select individual channels but there's no "All" tag.

    Actually I suspect that the problem is in the National Instruments OPC Server.
    DataSocket can read array data types from an OPC Server, but National Instruments' OPC Servers do not publish data in an array format.
    Probably the easiest solution is to publish your shared variable in your network but don’t bind it trough the opc server, instead you have to use it like a standard global variable (bind to source method).
    Give a look to this document may lead you to a better solution.
    http://digital.ni.com/public.nsf/websearch/FA61036​7EC62574186257118005089F2?OpenDocument
    Hope these two tips can help you
    FiloP
    It doesn't matter how beautiful your theory is, it doesn't matter how smart you are. If it doesn't agree with experiment, it's wrong.
    Richard P. Feynman

  • LVE / OPC / Shared Variable / LV 8.0 & 8.2

    I try to communicate with an OPC Client having problems...
    There are two ways to do that:
    First way:
    Simply create a shared variable in my project file which I can use per drag & drop after deploying it. The shared variable uses the Labview Variable Engine (LVE) and the NI-PS-Protocol. If I have read it correctly, these shared variables can also be OPC items. And yes, it works but limited.
    Second way:
    Each control / indicator has a data binding tab under properties. There I can select data socket and pass manually the OPC protocoll reference (e.g. opc://localhost/National Instruments.Variable Engine/\\.\test\SGL Array) which is not very comfortable but it works unlimited.
    Is problem is that the second way works fine for Labview 8.0 and 8.2 but the first way works in a curios manner on Labview 8.0.
    That means:  In labview 8.0 I can use the shared variables as OPC items without problems but only for non-array data types. Each array type (SGL,DBL, Waveform,...) does not work. We used the shared variables as simple OPC items a long time and now intented to add an array realizing that it does not work. Than someone told us to install DSC Modul wich adds the OPC functionallity to LabView, seeming to solve the problem.
    The remaining fact is that LabView 8.2 has no need for the addionally OPC functionally of the DSC Modul. Way 1 and 2 works without problems in 8.2.
    Ok, we have an unlimited license of using LabView in all versions and with all toolkits. But we want to use LabView 8.0, because our vis are programmed there and we do not to intend and vesion upgrade.
    If there is no solution here, we can use way to, but I am really interested, why shared variable arrays are not supporting OPC compatibility while non-array data types do.
    THX for an answer, best regards from Berlin

    Please refer to that thread http://forums.ni.com/ni/board/message?board.id=170&message.id=76313&view=by_date_ascending&page=1 for further information.

  • How to create an array containing shared variable values

    Hi
    I am trying to programmatically create an array containing shared variable values and their names.  I can get the variable names by supplying the process name to the get shared variable list function.  How do I then read the value of all the shared variable items returned?
    I have used a data socket open to open a connection to all variables when my program starts.  I then use datasocket read on the opened connections to write to an array.  This works fine until I try to write to one of the variables using a shared variable node.  The variables writes can take from 4secs to 2 mins.  When I remove the shared variable node again all is fine.  Also when I stop using the data sockets, all is fine.
    Is there a conflict between shared variable nodes and data socket writes to the shared variables?
    Can anyone help?  I cannot easily post example code because I am reading the variables from a Wago PFC (PLC) using OPC.

    Hi
    Sorry I forgot to mention the LabVIEW version, its 8.20.  I have tried saving the shared variable node as a sub VI and it makes no difference.
    Attached is a stripped down version of the software.  You will not be able to connect to the IO server because it requires some Wago hardware and software.  You may spot something I have done wrong with the I/O servers, variables or sub VI's.
    The main program that runs is called 'HMI Engine' in the 'Framework' folder.  There may be some other things in the project that aren't used in this example.  I have removed all but the variable connection part of the code.
    I hope someone can help!?
    Thanks
    Mark.
    Attachments:
    HMI Test.zip ‏144 KB

  • 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.

  • 2D double array shared variable in real-time application

    Hi,
    I am using Labview 8 and I created a real-time application using shared variables. Is it possible to create a 2D array of double (I don't find how to do itdirectly). Probably I can define my own control and load this control as the custom data type of my variable. But is it recommended to do that?
    Thank you
    Alexandre Boyer

    Another way to do this is to specify your shared variable to be a custom control and create a control that simply has a 2-D array in it.  I've attached a zipped LabVIEW 8.2 project that shows both methods.  Enjoy!
    Becky
    Becky Linton
    Field Engineer - Michigan
    National Instruments
    Attachments:
    2DArraySharedVariable.zip ‏110 KB

  • 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

  • Shared Variable based on Array of cluster

    Hello,
    I've created a shared variable which is based on an array of cluster (typedef). The cluster only contians two double elements for x-y coordinates of a point.
    Everything seems working until I found the shared variable can only hold the first two elements when I pass an array to it.
    Are there any settings I've missed?
    Thanks
    Yan

    Data is simply created and directly sent to SV.
    The difference during defining the SV is:
    Normally, when define an array SV, it allows to change the "Number of elements" (default as "2").
    However, when define a typedef array SV, the option is gone. Does it then use the default number "2" as the number of elements?

  • Array of string in a shared variable

    I am trying to write a 1-D array of strings to a network published shared variable, but it does not seem to write it. On the host, I can read the variable after I write to it, but I can't read it on the remote system (real-time). It is always blank. I checked the System Manager and it also shows the variable to be NULL.
    Solved!
    Go to Solution.

    Hi,
    It sounds like there might be a problem with the way you are publishing your network shared variables. Do you have any other shared variables of a different type that are working?
    What machine is hosting the variables? In either case, make sure they are deployed correctly. If the variables are hosted on your PC, check the Variable Manager and ensure that your variable is listed there and is being correctly updated. If it is, ensure your network is not blocking port traffic (turn off any firewalls.) Also ensure the path to the shared variable in real time is pointing to the correct location of the shared variable engine.
    Asa Kirby
    CompactRIO Product Marketing Manager
    Sail Fast!

  • 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

  • Shared variable data type: Can I choose an array of a custom typedef, without making the array itself a typedef?

    Hi all,
    I'd like to pass an array of a cluster across my network. My cluster is typedef'ed, but I'd like to avoid polluting my project with another redundant typedef.
    Is it possible to use the shared variable's "From Custom Control..." option with an array, without saving the array as a new .ctl file?
    Solved!
    Go to Solution.

    Ah, I didn't realize you were using shared variables. I thought you were just considering it as another option along with TCP/IP or UDP or something like that. In this case, you would have to create a second custom control. This control would be an array with teh typedef cluster in it. No need to make this new control itself a typedef though. Sorry, I know you were hoping for a different answer. I doubt one file will really "clutter" your project though
    CLA, LabVIEW Versions 2010-2013

  • Custom data type causing trouble in deploying shared variable to RT target

    I seem to be having some difficulty in using a network published shared variable created from a custom data type when deployed as an executable on an RT cRIO target.  I'll start by describing why I believe this is where the problem lies.  I created my RT VI in the LabVIEW development environment (LV 2012) and everything works fine.  This VI is pretty simple because it rapidly devolved in to a debug exercise.  The RT VI starts by simply blinking the User LED a couple of times and then starts a simple acquisition loop to read a few values off the hardware using the scan engine (while still blinking the User LED).  After reading the hardware, the values are bundled in to a cluster and written to a network-published shared variable defined by a type def custom control.  The custom control contains five dbl precision floats.  If it matters, the cRIO RT system hosts the shared variable in this case.
    So, I deploy this under the development environment and everything works fine.  The LED blinks merrily along, telling me that the program is running properly.  Running a host VI that reads the network-published shared variable yields the desired result.  All is good.
    Now I want the cRIO system to run this simple program autonomously at startup.  I build it, set it as the startup VI, deploy it and then restart the cRIO target.  The LED never starts blinking... the VI does not seem to run.  I will spare you most of the debugging work and jump to the end.  I basically "Diagram Disabled" various sections of code until the VI started running correctly as an executable.  I kept reducing the size of the disabled code until only one thing was disabled:  the write to the custom data type shared variable.
    So, I guess my question is this:  Are custom data types defined by type def'd custom controls allowed in executable RT programs?  I've read through the cRIO Developers Guide, my NI Real Time Development course book and the Using Shared Variables white paper and I didn't see anything that forbade it.  I know that there are some things not allowed in executables that are allowed in the development environment (front panel property nodes, dialog VIs, OS-specific calls, etc), but no mention of custom data type shared variables.  Any ideas as to why my VI runs in the development environment but fails when compiled unless I remove the write to the network published shared variable?
    Thanks in advance for your help!!
    Solved!
    Go to Solution.

    Paolo,
    So I thought that you meant to disconnect them in the build specification.  Under the Additional Exclusions in the build specification, there is a check box for Disconnect Type Defs.  I checked that box, recompiled, redeployed and it did not work.  At this point I had to give and move forward, so I was going to convert the data typed from a cluster to an array.  When I went in to change the data type in the shared variable pop-up from the project explorer, there was a big button under the variable definition that "Disconnect from Type Def".  Clicked that button, recompiled, redeployed, restarted and everything worked great.  Thank You!!
    I suspect that I'll have to be careful if I change the definition of that data type (add an element, etc) since it is no longer connected to the data type.  We'll cross that bridge when we need to.
    Thanks again

Maybe you are looking for

  • Operação PRD - Diferença de Preço

    Boa tarde Temos uma situação não identificada em nosso sistema e gostaria de ajuda para solucionar. Foi criado um pedido de compra com duas linhas, que possuem o mesmo material, na mesma quantidade. Duas MIGO's foram criadas para esse pedido e conseq

  • Mac Pro showing black and white lines when booting up

    Hello Apple community, My Mac Pro crashed yesterday after it was reading an empty DVD, and now if boot the Mac it shows this screen: I have tryed rebooting it in safe mode, does not work, I get the same screen. Tryed to use a other monitor, same prob

  • New Socket("IP" , 4444)

    I wrote a simple chat program, using Sockets, now on my Client program when I create the new Socket I run into errors... First of I must let you know that I am on a wireless connection set up in my house, therefore I am not directly connected to the

  • Can I burn .dmg files on a PC?

    Hello. I'd like to know if anyone here has any ideas on how to burn .dmg or .img files on a PC.

  • DPM Agent Installation Failed with Error code =0x80070643

    Hi, We had an Virtual Machine TFS server 2010 which had SQL server 2008 R2 installed on it. On this Server we were running an DPM 2010 agent and it was fine.  Then I had uninstalled DPM 2010 agent and  try to Install DPM 2012 R2 Agent on this Virtual