Unexpected pre-execution of panel script causes errors

Discuss suspected bugs with other users and Sim Innovations Staff

Moderators: russ, Ralph

Post Reply
Message
Author
User avatar
WillemijnL
Posts: 107
Joined: Sat Jan 30, 2016 1:14 pm

Unexpected pre-execution of panel script causes errors

#1 Post by WillemijnL »

I get many errors from my panel script because the panel script is executed many times before the script is realy started. Except for the last exectution the script is executed without the neccessary data which causes an error in a (library) function which is called with only nil values.

Even when starting AM the panel script is executed.

Code: Select all

2021-05-03 06:40:04 INFO  AMBase - Initializing
2021-05-03 06:40:04 INFO  AMBase - HW id = xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2021-05-03 06:40:06 ERROR InstrumentScanner - Instrument Switcher panel: Error loading instrument script: [string "logic.lua"]:186: attempt to call a nil value (field 'load_config')
2021-05-03 06:40:06 ERROR InstrumentScanner - Instrument Switcher panel: Error loading instrument script: [string "logic.lua"]:186: attempt to call a nil value (field 'load_config')
2021-05-03 06:40:06 ERROR InstrumentScanner - Instrument Switcher panel: Error loading instrument script: [string "logic.lua"]:186: attempt to call a nil value (field 'load_config')
When starting the panel, the script is executed several times before the script is realy started. The last time it runs fine and the library function works OK as expected. I added info logging to see what happens which is only visible the last time (last two lines). The error message indicates "Error loading instrument script", but the library is only part of the panel, not part of any instrument.

Code: Select all

2021-05-03 06:45:08 ERROR InstrumentScanner - Instrument Switcher panel: Error loading instrument script: [string "config_loader.lua"]:150: bad argument #1 to 'for iterator' (table expected, got nil)
2021-05-03 06:45:08 ERROR InstrumentScanner - Instrument Switcher panel: Error loading instrument script: [string "config_loader.lua"]:150: bad argument #1 to 'for iterator' (table expected, got nil)
2021-05-03 06:45:08 ERROR InstrumentScanner - Instrument Switcher panel: Error loading instrument script: [string "config_loader.lua"]:150: bad argument #1 to 'for iterator' (table expected, got nil)
2021-05-03 06:45:08 ERROR InstrumentScanner - Instrument Switcher panel: Error loading instrument script: [string "config_loader.lua"]:150: bad argument #1 to 'for iterator' (table expected, got nil)
2021-05-03 06:45:08 ERROR InstrumentScanner - Instrument Switcher panel: Error loading instrument script: [string "config_loader.lua"]:150: bad argument #1 to 'for iterator' (table expected, got nil)
2021-05-03 06:45:08 ERROR InstrumentScanner - Instrument Switcher panel: Error loading instrument script: [string "config_loader.lua"]:150: bad argument #1 to 'for iterator' (table expected, got nil)
2021-05-03 06:45:08 INFO  SiRunner - Instrument Switcher panel: logic.lua started
2021-05-03 06:45:08 INFO  SiRunner - Instrument Switcher panel: PanelConfig.load called
For testing the panel has 5 instruments at the moment (see Instrument switcher panel).

I expect the panel script is executed only once after instrument loading when the panel is started. Perhaps these errors also causes user properties not to be visible which is another issue.

User avatar
Sling
Posts: 5237
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: Unexpected pre-execution of panel script causes errors

#2 Post by Sling »

Not sure if you are just stating fact or looking for some help. If you are looking for help then it’s difficult to comment without seeing the script that generates these errors.

User avatar
WillemijnL
Posts: 107
Joined: Sat Jan 30, 2016 1:14 pm

Re: Unexpected pre-execution of panel script causes errors

#3 Post by WillemijnL »

Just stating and hopefully it can be fixed. Help is not needed. If Corjan needs the panel, I can send it to him. I don't want to publish it here at the moment, because the panel contains new tools that I only want to publish when they are finished.

User avatar
Sling
Posts: 5237
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: Unexpected pre-execution of panel script causes errors

#4 Post by Sling »

Probably better off just sending a pm then as it’s not really for the community.

Post Reply