12-07-2016 06:26 PM
Just learnt LAbview only a week ago. My supervisor had assigned me a project and asked me to create multiple number constant without doing it manually one by one. Any help or suggestions will be helpful.
Thanks.
12-07-2016 06:38 PM
Im a little confused by your question, if he wants you to programmatically create these constants you can use vi scripting, i provided some links on that. If you want a single enum constant that updates every instance of that vi when it is changed you should use type def.
attached example
12-07-2016 07:29 PM
Thank you for your reply. Sorry if I didn't explained it properly. Basically, my supervisor wants me to create a bunch of Enum constant into a loop sort of . Hope this helps.
Thanks.
12-07-2016 08:01 PM
It's a shame that your boss has tasked you to do something you know so little about that you can't even ask a basic question about it. 😞 This no reflection on you. It's like me trying to ask an intelligent question about assembly language.
I'm also having a difficult time understanding what it is you are trying to ask. 😞
12-07-2016 08:07 PM
Yeah, but you've gotta learn what you don't know,right? I'm sorry...I don't know how I can rephrase my question to make you understand better 😞
12-08-2016 05:07 AM
Try explaining your task. It doesn't make sense to create an enum in a loop. You'd need to be doing some kind of scripting that wouldn't really be all that useful if you're new to LV.
If you want to just copy it, copy/paste works.
If you want them to be linked, take a look at typedefs. I'd strongly suggest looking at this first. Once you make the typedef, then copy/paste works much better
12-08-2016 06:08 AM
Create an array of Enums? I think that's what the instructors means but asked for in a "puzzle" way as to not give you the answer.
/Y
12-08-2016 07:45 AM
On top of that the objects you have circled are actually Control Terminals, not constants. That might also be part of the confusion of what you are actually trying to do.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
12-08-2016 08:11 AM
Creating enums can be done without resorting to scripting. Generate an array of the strings you want, push them into the [Strings] of a ring property node and let the code run. Then right click the ring and choose "replace" and then choose an enum. Save the enum as a typ-def and you are done.
So scripting is not required except for the last step.
I also belive that you can set the strings of a enum provided the enum is not part of a VI that is reserved to run. Again no scripting required.
Ben
12-08-2016 09:17 AM
@Ben wrote:
Creating enums can be done without resorting to scripting. Generate an array of the strings you want, push them into the [Strings] of a ring property node and let the code run. Then right click the ring and choose "replace" and then choose an enum. Save the enum as a typ-def and you are done.
So scripting is not required except for the last step.
I also belive that you can set the strings of a enum provided the enum is not part of a VI that is reserved to run. Again no scripting required.
Ben
My favorite way of populating a huge enum - especially if I want to exactly match a document.