LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FGV With Array

3970c847-9458-4586-9f94-64a7c236c54b.png

Hello readers, so what I am trying to create is or should be pretty simple. I am trying to use this FGV as a way to write and read for four different indexes. Not sure if this should be that easy as instead to have four different FGV to do the same thing just base on the indexes.

0 Kudos
Message 1 of 6
(1,090 Views)

Hi A3,

 


@A3Ros wrote:

Hello readers, so what I am trying to create is or should be pretty simple. I am trying to use this FGV as a way to write and read for four different indexes. Not sure if this should be that easy as instead to have four different FGV to do the same thing just base on the indexes.


What is your question?

 

Why don't you use an array inside your FGV? Why do you need to hold 4 different bool values in 4 shift registers in (probably) 4 cases of y case structure???

 

Hint: we cannot debug/edit/run images in LabVIEW…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(1,073 Views)

Not sure if this should be that easy as instead to have four different FGV to do the same thing just base on the indexes.

 

I'm assuming that all of your "Channel" cases are all the same. This is not ideal.

If you find yourself repeating code with little or no differences, always consider rethinking the problem.

As much as I like spaghetti, it doesn't go well with software (error prone and hard to maintain). 

 

Check out the attached code (LabVIEW 2018).

On first call it initializes an array then performs the requested action.

----------------------------------------------------------------------------------------------------------------
Founding (and only) member of AUITA - the Anti UI Thread Association.
----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 3 of 6
(1,019 Views)

I'd make it an array internally and just index in/out one.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 4 of 6
(1,000 Views)

A3Ros_0-1679669265263.png

Actually this is what I wanted it. I figured it out after posting this.

0 Kudos
Message 5 of 6
(985 Views)

@A3Ros wrote:

A3Ros_0-1679669265263.png

Actually this is what I wanted it. I figured it out after posting this.


That'll work, but if you just make it an ordinary array you can skip the inner case structure altogether.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 6 of 6
(973 Views)