LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SharedVariableIO - Create SV

Hello,

I am creating my Shared Variables programmatically via SharedVariableIO. During startup I am reading my INI-File where also the datatyp is included. Especially it concerns the double datatype because after creating a SV with datatype double in the Variable Manager the SV has the datatype variant and not double. Why so? I am also using the logging functionality and with the datatype Variant I'm not able to set the value resolution and deadband which should be set to 0 to ensure that periodically a datapoint is written without value change.

I have attached a little example which should point up the issue.

Kind Regards,

Joachim
0 Kudos
Message 1 of 4
(2,495 Views)
Joachim,

I have experimented with the VIs you attached and discovered something that might help you.


The 'Variant' data type, that VarMan displays, should only be a display issue until the first write access to the variables. Afterwards, the data type is displayed correctly.

When using the 'Get Shared Variable List.vi' and reading the data type with a property node, I can see the correct data type directly after programmatic creation of the variables, so your application should run allright.

In my attached example, I have included a 'SV_Create_four_VARs.vi'. Run this to create four SVs with different data types. You can verify the created data types of the shared variables by running the 'SV_ReadDataType.vi'. If you now check VarMan, you will find the data type listed as 'Variant'. Now run the 'SV_Init.vi'. Now initial values are written to the SVs and VarMan displays correct data types.

Therefore, you might want to initialize all SVs in your application directly after creation.

Best regards,
Sebastian
0 Kudos
Message 2 of 4
(2,469 Views)
When creating SV programmatically is a library necessary. I don't see one (i.e a Library) in NI example. I'm using LV 8.2 so I can't open the attached zip example above
 
Thx, ahead of time
richjoh
0 Kudos
Message 3 of 4
(2,387 Views)
OK library is need for SV. NI example show no library deployed, the example VI is not a project, it just give pop-up to open SV manager...
0 Kudos
Message 4 of 4
(2,382 Views)