Enum with case structure | Arduino Compatible Compiler for LabVIEW Discussions | Forum

Avatar
Please consider registering
guest
sp_LogInOut Log In sp_Registration Register
Register | Lost password?
Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Feed Topic RSS sp_TopicIcon
Enum with case structure
February 23, 2017
11:59 pm
Avatar
David
Member
Members
Forum Posts: 22
Member Since:
January 28, 2017
sp_UserOfflineSmall Offline

On page 15 of the ACC4LV user manual, it shows that it's not possible to pass an enum output from a subvi to a case structure.  Is it also not allowed to pass an enum into a subvi with a case structure?  I was trying to consolidate some code making a combined read/write function and passing an enum to the read/write subvi, but have found that, although there are no compiler errors, the program doesn't actually work as expected.  The case structures always behave as if the enum value is zero.  Now that I think of it, it's not simply the case structure that's the problem, any enum wired to the input of a subvi seems to return zero as the value inside the subvi.  Did I just miss something in the user manual that warns against this? 

February 24, 2017
12:41 am
Avatar
Steffan
Admin
Forum Posts: 408
Member Since:
March 12, 2015
sp_UserOfflineSmall Offline

What is the datatype of the input to the subVI which you are passing an enum into?  Can you post a very simplified example of the problem so we can take a look?  I believe you should be able to pass and enum into a subVI.

February 24, 2017
1:00 am
Avatar
David
Member
Members
Forum Posts: 22
Member Since:
January 28, 2017
sp_UserOfflineSmall Offline

Ah, I found the error.  The enum type is U8, but my problem was that my subvi control input was labelled 'R/W', which uses a forbidden character, however the compiler did not report an error as indicated in the user manual.

February 24, 2017
1:09 am
Avatar
Steffan
Admin
Forum Posts: 408
Member Since:
March 12, 2015
sp_UserOfflineSmall Offline

Ok.  The forbidden character should have been automatically replaced by the Compiler.  Not quite sure why that didn't work for you but could be that variable naming got confused because of the replacement of illegal character and a new variable was created.  Glad you figured it out.

Forum Timezone: UTC 0
Most Users Ever Online: 100
Currently Online:
7
Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
miche91: 33
scottj: 28
scadao: 23
Member Stats:
Guest Posters: 5
Members: 202
Moderators: 0
Admins: 3
Forum Stats:
Groups: 1
Forums: 2
Topics: 266
Posts: 1222
Newest Members:
pujacontrol
Administrators: geadmin: 22, filipealtoe: 96, Steffan: 356