LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

average of a number of values acquired during a given time GPIB VISA

Solved!
Go to solution

I am working with a GPIB cable, and I am using VISA resources to code on LabVIEW.
I would like to program an average calculation.
The values I would like to use for this average would be acquired for a certain period of time before entering the calculation.
Currently, using a loop, I can acquire several values within a given time, but I don't know how to store them so that I can reuse them in my average calculation.
If I put in a text file, I only have the last value in memory, because in VISA, you cannot choose the number of samples like on the DAQ, and in array, the read buffer cannot be read, even after being converted by a scan chain. I changed in tools>Profile>buffer allocation so that it shows all types of strings etc... So I'm a bit out of ideas! Can anyone help me out?

I think what I'm missing mainly is how to use FA and FRA, which is a question of query I think, for the molbox I use. If anyone knows how they work together I'm interested. Knowing that the documentation provided by the manufacturer is not enough for me. 

 

Bonjour, je travail avec un câble GPIB, et j'utilise les ressources VISA pour coder sur LabVIEW.
j'aimerai programmer un calcul de moyenne.
Les valeurs que j'aimerai utiliser pour cette moyenne seraient acquises pendant un certain laps de temps avant d'entrée dans le calcul.
Actuellement, grâce à une boucle, je peux acquérir plusieurs valeurs en l'espace d'un temps donné, mais je ne sais pas comment les stocker pour pouvoir les réutiliser dans mon calcul de moyenne.
si je mets un fichier texte, je n'ai que la dernière valeur en mémoire, car en VISA, on ne peut pas choisir le nombre d'échantillon comme sur le DAQ, et en tableau, le buffer de lecture ne peut être lu, même après avoir été convertis par une chaîne de balayage. J'ai changé dans outils>Profil>allocation de buffer de tel sorte à ce qu'elle affiche tous les types de chaines etc... Je suis donc un peu à court d'idées! Quelqu'un saurait m'avancer ?

Je penses que ce qu'il me manque principalement c'est comment utiliser FA et FRA, question de requête propre je crois, au molbox que j'utilise. Si quelqu'un sait comment ils fonctionnent ensemble je suis preneuse. Sachant que le documentation fourni par le fabricant ne me suffit pas. 

 

Attached is my current diagram, with only a read buffer that displays only one value at a time.

 

Ci- joint mon diagramme actuel, avec uniquement un buffer de lecture qui n'affiche qu'une seule valeur à la fois.

0 Kudos
Message 1 of 12
(187 Views)

Hi Simon,

 


@aerosimon wrote:

I am working with a GPIB cable, and I am using VISA resources to code on LabVIEW.

I think what I'm missing mainly is how to use FA and FRA, which is a question of query I think, for the molbox I use. … Knowing that the documentation provided by the manufacturer is not enough for me. 


You surely work with more "devices" than just a GPIB cable, but you forgot to name the device and manufacture you are working with!

How should we know about those "FA" and "FRA" commands, when you don't supply any substantial information?

 


@aerosimon wrote:

Currently, using a loop, I can acquire several values within a given time, but I don't know how to store them so that I can reuse them in my average calculation.
So I'm a bit out of ideas! Can anyone help me out?


Create an array of the acquired scalar values! This is pretty basic LabVIEW stuff…

Best regards,
GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
0 Kudos
Message 2 of 12
(180 Views)

In fact I use a molbox, it's a flow measurement device.
I have of course created a table but it is not compatible with the VISA Read.

0 Kudos
Message 3 of 12
(178 Views)

Hi Simon,

 

again you attached just an image of code, but not the real code…

Are you talking about this "molbox" device?

 


@aerosimon wrote:

In fact I use a molbox, it's a flow measurement device.
I have of course created a table but it is not compatible with the VISA Read.


You created an array indicator labelled "Tableau", but not a table indicator as provided by LabVIEW!

A "table" is a 2D array of strings while your indicator is some kind of DBL array

 

As said before you need to collect your readings into an array before you are able to display that array in an array indicator.

 

This is not a problem of "VISARead not compatible to table indicator" but a problem of your wrong programming: I suggest to take those "Training resurces" as offered in the header of theLabVIEW board!

Best regards,
GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
0 Kudos
Message 4 of 12
(145 Views)

Hi Simon,

 

to attach code you should use the "browse files to attach" link below the message editor box.

 

The Training resources are available in the header (on top) of the LabVIEW board:

 

To "collect data in an array" you might use a shift register with BuildArray. Or the PtByPt-DataQueue…

Best regards,
GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
0 Kudos
Message 5 of 12
(133 Views)

ok, thanks, here I have my code, so it doesn't work. I work well with the molbox you sent me, so I have to look at the 6 lessons of LabVIEW training Resources?

0 Kudos
Message 6 of 12
(127 Views)

Hi Simon,

 


@aerosimon wrote:

so I have to look at the 6 lessons of LabVIEW training Resources?


Well, it never hurts to actually learn the basics before starting the actual programming…

 


@aerosimon wrote:

here I have my code, so it doesn't work.


Unfortunately I'm limited to LV2017 right now, so I cannot open the VI. (Mind to downconvert [aka "Save for previous"] and attach again?)

Best regards,
GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
0 Kudos
Message 7 of 12
(119 Views)

I am attaching the 2017 version, thank you.

0 Kudos
Message 8 of 12
(111 Views)
Solution
Accepted by topic author aerosimon

Hi Simon,

 

that's the simplest way to collect samples in an array:

Best regards,
GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
0 Kudos
Message 9 of 12
(102 Views)

I'm really sorry but I can't find the array of samples. I don't understand.

0 Kudos
Message 10 of 12
(97 Views)