LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PDA XY graph spike anomaly

Hey Guys n' Girls
 
I have this wierd problem with the XY graph draw function on the PDA module using  aTPC-2006.
 
I have set up a series of buttons corresponding to the colours on the graph.  and I want to re draw the graph without showing some of the other plots, so i use an array constant with a blank 0 in (double precision), if the switch is thrown, this all works well apart from spikes that keep appearing on the blank array graphs.
 
any help would be appriciated
 
Many thanks
 
Chris
0 Kudos
Message 1 of 4
(5,183 Views)

UPDATE

 

I replaced the blank array constant with a for loop that auto indexes from the shared variable and out puts the correct abount of zeroz and builds an array from that, and it works with no spikes.  Is it somethingo to do with the way the PDA module uses blank array constants, does blank array not neccessarly mean a array full of zero';s?

 

chris

0 Kudos
Message 2 of 4
(5,182 Views)
Hi chris,

a blank array as shown in your gif-picture is empty (array size = 0) and NOT 'full of zeros'!
How would you define the array size of such blank arrays?
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 4
(5,176 Views)

Hi,

It would be great if you could attach your VI to the discussion forum board so that we can take a closer look at the block diagram code. As you already know in LabVIEW creating an array is a two step process first you place the array shell on the front panel or block diagram and then you drag a data object or element into the shell. By doing so the shell incases around the element or data object. What you have effectively done is defined the array data type.

An array consists of elements and dimensions. Elements are the data that make up the array. A dimension is the length, height, or depth of an array. An array can have one or more dimensions and as many as (2 ) – 1 elements per dimension, memory permitting. Essential aspect to remember is that an array is 0 indexed. So with the example screenshot just typing the number '0' in just one data object or element of the array (a constant in the array) will allow you to define an array of size 0. Initially the data object or element in the array is grey but entering a value will make its colour brigher and this allows you to define its size. i.e. ignore greyed out ones. 

Unless you initialize a data object or element the array its size remains undefined. In text based programming languages you usually declare the array data type and size explicitly. The real beauty with LabVIEW arrays can quite easily be dynamically defined – not as easily done with text based language. For example place a random function generator function inside a while loop and wire it to the right hand border of the while loop – enable auto-indexing at the tunnel and create an array indicator output. If you want to define an array of fixed size in LabVIEW just use a for loop that has a fixed number of iterations (array size).

Looking at the block diagram screenshot I’m wondering what you have got happening in the true case for the third case structure?

All the best

Kirtesh Mistry

Applications Engineer

National Instruments UK & Ireland

0 Kudos
Message 4 of 4
(5,152 Views)