LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Ring converted into intiger after unbundling a cluster

Solved!
Go to solution

Hello everyone! 

 

I have a problem while unbundling typedef cluster. Cluster contains one bool and two ringss. After unbundling ringss are converted into intigers and all informations about text labels of rings are lost... How to save ring labels after unbundling? 

 

Best regards

Dominik Bejma

DominikBejma_0-1720189702863.png

 

0 Kudos
Message 1 of 10
(451 Views)

Hi Dominik,

 


@Dominik.Bejma wrote:

I have a problem while unbundling typedef cluster. Cluster contains one bool and two ringss. After unbundling ringss are converted into intigers and all informations about text labels of rings are lost... How to save ring labels after unbundling? 


Copy the rings fron that tpedef onto your frontpanel and switch them to indicator…

 

Rings are just U16 values, the text is (more or less) just decoration.

Best regards,
GerdW


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

If the ring items are static, I recommend to replace the rings with enums.

0 Kudos
Message 3 of 10
(422 Views)

@Dominik.Bejma wrote:

Hello everyone! 

 

I have a problem while unbundling typedef cluster. Cluster contains one bool and two ringss. After unbundling ringss are converted into intigers and all informations about text labels of rings are lost... How to save ring labels after unbundling? 

 

Best regards

Dominik Bejma

DominikBejma_0-1720189702863.png

 


I am not surprised! The picoscope driver failed to provide type defs for the Range and Coupling controls within the typedefed Settings cluster!  

You should, of course,  create the missing type definitions and replace the non type defined instances throughout the instrument driver.  Then submit feedback on that instrument driver to the Instrument Driver Network (or to wherever you downloaded that poorly developed software.)


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 10
(406 Views)

@altenbach wrote:

If the ring items are static, I recommend to replace the rings with enums.


In the CLD recert practice test, it there's a question about how to update a typedef'd ring on the block diagram, and the answer is by changing the integer type.  I never tested it yet, but does it update all the properties?  It seems like the answer would be "yes", but the test is pretty ambiguous about a lot of the questions, so...

 

Edit: yes it does!  I tested this first by updating the items in the typedef'd ring and applying.  The BD constant text did not update.  Then I changed it to u8 and the BD items updated.

 

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 5 of 10
(380 Views)

@billko wrote:


In the CLD recert practice test, it there's a question about how to update a typedef'd ring on the block diagram, and the answer is by changing the integer type. ...

 

I changed it to u8 and the BD items updated.


If you do something like this, you should always convert to a type which can cover all the possible ring values (hopefully your ring doesn't already start as a 64 bit type) to avoid losing actual values.


___________________
Try to take over the world!
Message 6 of 10
(361 Views)

@JÞB wrote:


You should, of course,  create the missing type definitions and replace the non type defined instances throughout the instrument driver.  Then submit feedback on that instrument driver to the Instrument Driver Network (or to wherever you downloaded that poorly developed software.)


I don't know if I would recommend touching driver code which is not under your control. It might be preferable to create a VI which translates that ring or cluster into a type which you can use and call that whenever you need the data.

 

I agree with the general advice of creating an enum typedef of the values (you can generally replace a ring control with an enum and get the same values if the ring has an unsigned type and the values are contiguous from zero. Otherwise, you will need a translation VI).

As another option, making the ring into a strict typedef also helps in keeping the values better than a regular typedef.


___________________
Try to take over the world!
0 Kudos
Message 7 of 10
(359 Views)

@tst wrote:

@billko wrote:


In the CLD recert practice test, it there's a question about how to update a typedef'd ring on the block diagram, and the answer is by changing the integer type. ...

 

I changed it to u8 and the BD items updated.


If you do something like this, you should always convert to a type which can cover all the possible ring values (hopefully your ring doesn't already start as a 64 bit type) to avoid losing actual values.


Yes, that is a good reminder.  It would avoid a lot of sad faces.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 8 of 10
(352 Views)

Well, the longer I use picoscope provided VI and examples, the more I'm convinced about absurdly low quality of their LabView libraries. No documentation, no quick help, no comments, lot of bad practices, a lot of obscure and qestionable programming techniques... 

Message 9 of 10
(342 Views)
Solution
Accepted by Dominik.Bejma

If you have a bad API to deal with and you need to work with it over time or have multiple people using it, I would suggest replacing it. Here are two options:

  1. Recreate or modify the existing API to be better (working on your own separate copy, of course). This would require implementing the relevant low-level calls in your VIs (VISA, GPIB, DLLs, .NET, etc.).
  2. Leave the existing API as it is and create a user friendly wrapper around it which hides all of the details of the original. That way, you only need to deal with the bad API when you initially develop the wrapper. The wrapper doesn't necessarily have to support all of the functionality offered by the original API, just what the user of the new API will need.

___________________
Try to take over the world!
Message 10 of 10
(323 Views)