Nested loops within subVIs | 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
Nested loops within subVIs
October 3, 2015
1:11 pm
Avatar
threelock
Member
Members
Forum Posts: 5
Member Since:
August 5, 2015
sp_UserOfflineSmall Offline

I ran into an issue where I curve fit a thermistor to a 3rd order polynomial. I don't find a x^y function so I wrote a subvi that's essentially a for loop with a shift register to do that. It doesn't work, it just outputs zero. When I copy the code into the parent VI it works fine. I get the same result on a UNO and a MEGA. If I take out the serial writes it seems to work fine run on Windows.

I'm attaching the working and non-working code. I'm running LV2015 and 1.0.0.19 version of the toolkit.

 

Thanks,
Andrew

October 3, 2015
6:01 pm
Avatar
filipealtoe
Admin
Forum Posts: 98
Member Since:
March 12, 2015
sp_UserOfflineSmall Offline

Hi Threelock;

Thanks for bringing this to our attention. I still need to do some deeper debugging, but at a first glance, it seems the issue is related to the character "^" on the indicator "x^power" inside the power.vi subVI. Recently we have added protection against bad characters like that on control names, but we may have missed that for subVI declarations as that goes through a different code execution branch. I haven't tried it on the Arduino yet, but in looking at the intermediate generated code, it seems that if you change that variable name from x^power to x_power, for example, it will work. Can you give that a try? If that indeed fixes the problem, I will look into extending that protection against bad characters on control/indicators names for subVI declarations as well and rolling that fix into the next release.

Thanks again and sorry for the inconvenience.

Filipe

Cheers
Filipe

October 3, 2015
6:28 pm
Avatar
threelock
Member
Members
Forum Posts: 5
Member Since:
August 5, 2015
sp_UserOfflineSmall Offline

Yes, that fixed it!

Also, glad I'm not crazy. I didn't mention it before, but I spent some time making multiple levels of subvi's in a dummy program to see if that was the problem somehow, but couldn't recreate my issue outside of that specific program. The indicator label didn't even occur to me. 

Thanks!

October 3, 2015
6:31 pm
Avatar
filipealtoe
Admin
Forum Posts: 98
Member Since:
March 12, 2015
sp_UserOfflineSmall Offline

Awesome! I'm working on the fix (have some regression testing currently running) as I type this reply. Thanks for helping figuring this out. The isolation of the bug work you did helped tremendously.

Filipe

Cheers
Filipe

Forum Timezone: UTC 0
Most Users Ever Online: 100
Currently Online:
45
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