Academic Company Events Community Support Solutions Products & Services Contact NI MyNI
2 rating:
 1 out of 5     Rate this Document

Warning -1950679034 when Reading a Shared Variable

Primary Software: LabVIEW Development Systems>>LabVIEW Base Package
Primary Software Version: 1.0
Primary Software Fixed Version: N/A
Secondary Software: LabVIEW Modules>>LabVIEW DSC Module

Problem:
When trying to read a shared variable, I receive Warning -1950679034.  Why does this happen and how can I prevent it?

Solution:
Warning -1950679034 is a warning that the shared variable you are trying to read has no known value. Warning codes do not halt execution, but they may be an indication of bad data. If you have just created or deployed the variable, it may not have been written to yet. If you have created an IO server, there could be a communication failure preventing the shared variable from receiving data.

You can prevent this warning by enabling the Initial Value option in the shared variable properties page. Once you set an initial value, you will have to redeploy the library. Alternatively, you can initialize the shared variable by writing a value to the variable either in your code or using the Distributed System Manager.

Please keep in mind that it is considered good programming practice to give a shared variable time to initialize as well by putting a delay, such as a wait function, before reading a shared variable. An example of this is shown in the figure below. This is only necessary on the first read of a shared variable and if there is not enough code before the shared variable is read to allow sufficient time for the variable to initialize.

Good Code



Related Links:
KnowledgeBase 4L6BP728: How to Avoid the "0" Value at First Read of a Shared Variable in LabVIEW 8.5.x?

Attachments:

Good Codegood code.png






Report Date: 01/06/2009
Last Updated: 12/12/2013
Document ID: 4T5DE9U8

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit