From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Reference Design Content

cancel
Showing results for 
Search instead for 
Did you mean: 

Point Value Map Library

Processes commonly need to read properties that other processes write.  Maps contain points, which work like variables that store only the latest value written to them. In other words, point value maps are repositories of information that any process can read and write at run time.

 

In the example of reading the current operating state of a machine, processes do not require knowledge of every change in operating state that occurs, but rather, only the current state. Point value maps are designed for this use case, where the device software must store a value in memory that readers and writers can access with no flow control.

 

Description

 

Map Features:

  • Maps and map point persist until the code restarts.
  • Map points consist of a key-value pair.
  • Each map can contain multiple points, which are identified by name.
  • Multiple maps can exist simultaneously, each of which is identified by name.
  • Points support values whose data type is string, double, integer, Boolean, or variant.
  • Points support a few types of attributes: a property that indicates whether the point value is valid, a timestamp that indicates when the value was written, and generic user-defined attributes.

 

Examples

 

The palette for the Point Value Map Library can be found under Addons.

 

PVMPalette.PNG

 

Below is a simple example showig how to write and then read points from a map.

 

PVMExample.PNG

 

Requirements

 

Software

 

Support

 

Please post comments, feedback and questions in the comments below.

 

History

 

Version Date Description/Changes
1.0.0.2 March 2016 Initial Release
     
     

 

Downloads

 

Use VI Package Manager (VIPM) to install this library.

 

Point Value Map Library on VIPM

Comments
E.Garcia
NI Employee (retired)
on

Hi.

When would you suggest using this library instead of the alternatives such as the Current Value Table one?

http://www.ni.com/example/30326/en/

Jack_A.
Active Participant
Active Participant
on

Great question!  Functionally, the CVT and Point Value Map (PVM) serve the same purpose, but there are differences between the APIs.  The PVM allows for multiple maps to coexist at teh same time while the CVT only has a single map.  Having multiple maps allows for more reuse in code since one API could use a unqiuely named map and export the data in the map through an API.  This could live alongside another API doing the same thing.  The example would be a configuration API that manages configuration could store the data in a map and at the same time an analysis API could store its results in a separate map without the two conflicting.  Another big difference between the two are the datatypes that are supported.  PVM supports a few basic datatypes (DBL, string, I32) as well as the variant for more advanced tpyes.  CVT supports lots of basics types but no advanced ones.  So if you have a complex data structure, CVT is not an easy place to store it.

Does that help?

E.Garcia
NI Employee (retired)
on

Makes a lot of sense.

Thanks for the detailed explanation Jack.

rhoward991
Member
Member
on

Where is the custom attribute getter VI? I can set them, but I can't get them.

Mads
Active Participant
Active Participant
on

I like the Point Map solution very well as it fits the type of tag storage I often need (value, timestamp+quality), and is more flexible (than CVT for example) when it comes to creating points on demand.

 

Due to the use of a more complex data type, the underlying variant-based storage of the point map is a bit slower than it could be though. I modified this hash based solution by crabstew to hold the pointmap data natively, then inserted that into the pointmap solution...and it is 10x faster on my cRIO 9036 target. (If it's ok for everyone involved I could post the joint solution).

jaws13fr
Member
Member
on

Hello,

 

Great work here. It will save me some time, thank you !

 

@Mads  Is your code available somewhere ?

jorgeinSD
Member
Member
on

@Mads

Is it too late to request your PVM solution? - using LV2018. 🙏

 

JorgeN

 

Contributors