Jump to content

Connecting ring with case structure


Sharon_

Recommended Posts

Hi,

When we connect enum or ring(with items 0,1,2,3,4,5..) with case structure, the case structure shows only 2 cases - default value and one more.

Is it possible to display all the cases, when the cases are connected to the structure.

The problem is, I want to do this programatically using VI scripting and I dont know which property to change..

Please help..!!!!

Thanks in advance....!!!!

-Sharon

case.vi

Link to comment

Hi,

When we connect enum or ring(with items 0,1,2,3,4,5..) with case structure, the case structure shows only 2 cases - default value and one more.

Is it possible to display all the cases, when the cases are connected to the structure.

The problem is, I want to do this programatically using VI scripting and I dont know which property to change..

A ring control only is a number. Its datatype does not contain any information as to how many elements the Ring Control contains, since that can be changed at runtime through one of its properties, while datatype information has to be defined at compile time. So there is no automatic way to have a case structure adapt to a Ring Control since there is nothing to adapt to, in comparison when you do the same with an enum.

The scripting interface of the case structure should have a property that is an array of strings and that should allow to define the number of cases and their values.

Link to comment

A ring control only is a number. Its datatype does not contain any information as to how many elements the Ring Control contains, since that can be changed at runtime through one of its properties, while datatype information has to be defined at compile time. So there is no automatic way to have a case structure adapt to a Ring Control since there is nothing to adapt to, in comparison when you do the same with an enum.

The scripting interface of the case structure should have a property that is an array of strings and that should allow to define the number of cases and their values.

Hi,

Manually it is okie . I can see the 'Add case for every value'. But while writing VI scripts I dont find any options like that.

I have attached my VI along with this post for your ref.

Could you pls tell me what is wrong with my VI..?

Thanks for your time..!!!

Sharoncase_enum.vi

Link to comment

Hi,

Manually it is okie . I can see the 'Add case for every value'. But while writing VI scripts I dont find any options like that.

I have attached my VI along with this post for your ref.

Could you pls tell me what is wrong with my VI..?

Thanks for your time..!!!

Sharoncase_enum.vi

To create a case for every value you can:

1) remove empty cases (you now have one case)

2) use the (size of the enum strings - 1) to determine how many new frame to add.

Note: I changed the example to create a new VI instead of open an existing one since I don't know the context of your use case.

hope this helps

case_enum.vi

Link to comment

Hi,

Manually it is okie . I can see the 'Add case for every value'. But while writing VI scripts I dont find any options like that.

I have attached my VI along with this post for your ref.

Could you pls tell me what is wrong with my VI..?

Thanks for your time..!!!

Sharoncase_enum.vi

Look for the property FrameNames of the CaseSel class. This is an array of strings much like the Strings[] property for enums.

Link to comment

Look for the property FrameNames of the CaseSel class. This is an array of strings much like the Strings[] property for enums.

OK. I've looked now :P

Its a little bit more complicated than that, since the frame names has to match the number of cases. If you just wire it to an array of strings, you will get an error and only 2 cases will have the names. You have to create the correct number of cases (array length - 2) using the "add frame" invoke node then wire your string array to it.

Link to comment

To create a case for every value you can:

1) remove empty cases (you now have one case)

2) use the (size of the enum strings - 1) to determine how many new frame to add.

Note: I changed the example to create a new VI instead of open an existing one since I don't know the context of your use case.

hope this helps

Thank you very much Dan, rolfk and Shaun . :rolleyes: You people are really great and this forum really rocks..!!! :wub::yes:

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.