LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error messages appear to late

Hi,

In relation to the program I sent befour and have another problem. I want to do a general program which calls several times to the same subVI. The subVI has to error indicators which has to show in the main program and the problem is that the errors appears to late in the main program, appears when the execution finished.

I attach the subVI and the main program

 

Best regards,

0 Kudos
Message 1 of 32
(3,170 Views)

Hi 99,

 

how often have you been told to learn LabVIEW basics, including the mantra "THINK DATAFLOW!"?

 


@labview99 wrote:

The subVI has to error indicators which has to show in the main program and the problem is that the errors appears to late in the main program, appears when the execution finished.


The "error" is shown in the calling MainVI as soon as DATAFLOW allows…

(Exactly like you have it programmed to work!)

 

Are you sure you need a large sequence structure in the MainVI to call your subVI 5 times? Could a FOR loop do the same job - much simpler, much more readable?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 32
(3,157 Views)

But if I execute the subVi only the error of REARMAR it works okey, but when I execute the mainVI it doesn´t work

0 Kudos
Message 3 of 32
(3,145 Views)

Hi 99,

 


@labview99 wrote:

But if I execute the subVi only the error of REARMAR it works okey, but when I execute the mainVI it doesn´t work


The subVI executes the very same way if you call it from your MainVI or by starting it manually. So I guess this "it doesn't work" claim is wrong…

 

(There is another problem in the frame where you write "BARRERA INVADIDA" to the ERROR indicator, but this applies independently how you call that VI.

Also the indicator showing this "REARMAR" string has no label: NEVER delete the labels of frontpanel elements!)

Best regards,
GerdW


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

The program that I am doing is to control one cylinder. I want to sent the cylinder to different positions. Now, I find the way to send the cylinder to different posiitons. But I want to take into account also de errors that can occur during the movement of the cylinder. Such as, the movement can be stopped because somebody invade barrier. And if that occur I want to rearm and send again to the position. And when I try to do this the cylinder doesn´t move.

Best regards

0 Kudos
Message 5 of 32
(3,109 Views)

I attach the programs, sorry

0 Kudos
Message 6 of 32
(3,106 Views)

Hi 99,

 


@labview99 wrote:

Now, I find the way to send the cylinder to different posiitons. But I want to take into account also de errors that can occur during the movement of the cylinder. Such as, the movement can be stopped because somebody invade barrier. And if that occur I want to rearm and send again to the position. And when I try to do this the cylinder doesn´t move.

It's fine you already started to create a statemachine in your MainVI. You should do the same with your subVI!

 

Your subVI can be improved and siomplified a lot, this is just a simple suggestion for the first step:

check.png

When you understand the code in this image then you should start to think about using strings to store numeric values: that's pure Rube-Goldberg!

 

The first frame(s) look like this:

check.png

Why is Velocidad a DBL value when your device only handles U8 data?

Why do you need to convert Posicion to a hex-formatted string? Simply convert the scaled DBL value to an U16 value and use SplitNumber to get both bytes. After doing so you can compare the resulting position with the setpoint position using both U16 values…

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 32
(3,102 Views)

Hi GerdW,

 

I have to convert to hex-formatted string because I need to do the opertion by numerical instruction. But why in the mainVI after showing the message of REARMAR I sent to the case posicion1 of my case structure and the cylinder doesn´t move.

 

Best regards

0 Kudos
Message 8 of 32
(3,056 Views)

Hi 99,

 


@labview99 wrote:

Hi GerdW,

 

I have to convert to hex-formatted string because I need to do the opertion by numerical instruction.


No, you don't need to use strings to do numeric calculations! That's Rube-Goldberg!

check.png

Your subVI after some improvements - as suggested before several times!

 


@labview99 wrote:

But why in the mainVI after showing the message of REARMAR I sent to the case posicion1 of my case structure and the cylinder doesn´t move.


Where do you do this in the latest version of your MainVI? I cannot spot that…

(Btw. you should be able to answer that by using debugging techniques like probes and highlight execution!)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 9 of 32
(3,049 Views)

Hi GerdW,

I have simplifyed the subVI as you told me first. 

The mainVI starts when I introduce one posiiton where I want to sent the cylinder. And when it reads this position the cylinder start moving. But, if somebody stop the movement, the program stops. So I want to show one message and then go back to repeat the subVI in the posicion1.

Captura.PNG

In this case, first I show a message of RESETEAR and then I want to go again to the first case which is posicion1. And in the case of posicion1,  the program has to repeat again the subVI to move the cylinder to the correct position. 

Doing this I am supossing that the movement of the cylinder is stopped in the middle and after showing the message of RESETEAR i would like to go to the case posicion1, to complete the movement.

 

Best regards

0 Kudos
Message 10 of 32
(3,043 Views)