program script syntax issue?

Hi,

I have the following program script running in the deployment component

program startup {
do loadComponents("deployment.cpf")
do configureComponents()
// do firstMode.configure()
do secondMode.configure()
do adaptor.configure()
do Logical.start()
do Logical.LogicalStateMachine.activate()
}

However, when I run this program, it is not executed completely as I expect, indeed the first to statements are executed correctly, and then I get

[...]
159.260 [ Info ][ExecutionEngine::setActivity] secondMode is periodic.
159.260 [ Info ][Logger] Configuration successful.

In Task Deployer[R]. (Status of last Command : busy )
(type 'ls' for context info) :list startup
1 program startup {
2 do loadComponents("deployment.cpf")
3 do configureComponents()
4 // do firstMode.configure()
E> 5 do secondMode.configure()
6 do adaptor.configure()
7 do Logical.start()
8 do Logical.LogicalStateMachine.activate()
9 }

In Task Deployer[R]. (Status of last Command : busy )
(type 'ls' for context info) :secondMode.configure()
Got :secondMode.configure()
= 177.477 [ Info ][Logger] Configuring secondMode
177.477 [ Info ][Logger] Simulink Target info
177.477 [ Info ][Logger] ====================
177.477 [ Info ][Logger] Model name : secondMode
177.477 [ Info ][Logger] Model base rate : 0.2
177.477 [ Info ][Logger] Number of sample times : 2
177.477 [ Info ][Logger] Sample time 0 : 0
177.477 [ Info ][Logger] Sample time 1 : 0.2
177.477 [ Warning][Logger] Forcing base rate to : 0.1
177.477 [ Info ][Logger] Setting port Input to 5
177.477 [ Info ][Logger] DataPort Input is an INPUT port.
177.477 [ Info ][Logger] Monitor inputs: 3
177.477 [ Info ][Logger] Monitor outputs: 3
177.478 [ Info ][Logger] Monitor params: 3
177.478 [ Info ][Logger] Initialising port Monitor.
177.478 [ Info ][Logger] Setting port Output to 0
177.478 [ Info ][Logger] DataPort Output is an OUTPUT port.
true

Note this statement succeeds (as do the commands on line 2 and 3 of the program script).
I obtain similar behaviour if the firstMode.configure() statement is uncommented, and VERBOSE logger mode doesn't show anything suspicious.

What am I doing wrong here?

Klaas

program script syntax issue?

On Thursday 22 May 2008 14:15:54 Klaas Gadeyne wrote:
> Hi,
>
> I have the following program script running in the deployment component
>
> program startup {
> do loadComponents("deployment.cpf")
> do configureComponents()
> // do firstMode.configure()
> do secondMode.configure()
> do adaptor.configure()
> do Logical.start()
> do Logical.LogicalStateMachine.activate()
> }
>
> However, when I run this program, it is not executed completely as I
> expect, indeed the first to statements are executed correctly, and then I
> get
>
>
> [...]
> 159.260 [ Info ][ExecutionEngine::setActivity] secondMode is periodic.
> 159.260 [ Info ][Logger] Configuration successful.
>
>
> In Task Deployer[R]. (Status of last Command : busy )
> (type 'ls' for context info) :list startup
> 1 program startup {
> 2 do loadComponents("deployment.cpf")
> 3 do configureComponents()
> 4 // do firstMode.configure()
> E> 5 do secondMode.configure()
> 6 do adaptor.configure()
> 7 do Logical.start()
> 8 do Logical.LogicalStateMachine.activate()
> 9 }
>
> In Task Deployer[R]. (Status of last Command : busy )
> (type 'ls' for context info) :secondMode.configure()
> Got :secondMode.configure()
> = 177.477 [ Info ][Logger] Configuring secondMode
> 177.477 [ Info ][Logger] Simulink Target info
> 177.477 [ Info ][Logger] ====================
> 177.477 [ Info ][Logger] Model name : secondMode
> 177.477 [ Info ][Logger] Model base rate : 0.2
> 177.477 [ Info ][Logger] Number of sample times : 2
> 177.477 [ Info ][Logger] Sample time 0 : 0
> 177.477 [ Info ][Logger] Sample time 1 : 0.2
> 177.477 [ Warning][Logger] Forcing base rate to : 0.1
> 177.477 [ Info ][Logger] Setting port Input to 5
> 177.477 [ Info ][Logger] DataPort Input is an INPUT port.
> 177.477 [ Info ][Logger] Monitor inputs: 3
> 177.477 [ Info ][Logger] Monitor outputs: 3
> 177.478 [ Info ][Logger] Monitor params: 3
> 177.478 [ Info ][Logger] Initialising port Monitor.
> 177.478 [ Info ][Logger] Setting port Output to 0
> 177.478 [ Info ][Logger] DataPort Output is an OUTPUT port.
> true
>
> Note this statement succeeds (as do the commands on line 2 and 3 of the
> program script). I obtain similar behaviour if the firstMode.configure()
> statement is uncommented, and VERBOSE logger mode doesn't show anything
> suspicious.
>
> What am I doing wrong here?

Can you test the same sequence using valgrind ? It's such absurd behaviour...
I'm guessing this is Simulink related and that configure() really returns
false. The only place where this happens without logging a message is in:

// Give base class a chance to pre-configure
if ( BASECLASS::configureHook() == false)
return false;

Peter

program script syntax issue?

On Thu, May 22, 2008 at 3:01 PM, Peter Soetens

<peter [dot] soetens [..] ...> wrote:
> On Thursday 22 May 2008 14:15:54 Klaas Gadeyne wrote:
>> I have the following program script running in the deployment component
>>
>> program startup {
>> do loadComponents("deployment.cpf")
>> do configureComponents()
>> // do firstMode.configure()
>> do secondMode.configure()
>> do adaptor.configure()
>> do Logical.start()
>> do Logical.LogicalStateMachine.activate()
>> }
>>
>> However, when I run this program, it is not executed completely as I
>> expect, indeed the first to statements are executed correctly, and then I
>> get
>>
>>
>> [...]
>> 159.260 [ Info ][ExecutionEngine::setActivity] secondMode is periodic.
>> 159.260 [ Info ][Logger] Configuration successful.
>>
>>
>> In Task Deployer[R]. (Status of last Command : busy )
>> (type 'ls' for context info) :list startup
>> 1 program startup {
>> 2 do loadComponents("deployment.cpf")
>> 3 do configureComponents()
>> 4 // do firstMode.configure()
>> E> 5 do secondMode.configure()
>> 6 do adaptor.configure()
>> 7 do Logical.start()
>> 8 do Logical.LogicalStateMachine.activate()
>> 9 }
>>
>> In Task Deployer[R]. (Status of last Command : busy )
>> (type 'ls' for context info) :secondMode.configure()
>> Got :secondMode.configure()
>> = 177.477 [ Info ][Logger] Configuring secondMode
>> 177.477 [ Info ][Logger] Simulink Target info
>> 177.477 [ Info ][Logger] ====================
>> 177.477 [ Info ][Logger] Model name : secondMode
>> 177.477 [ Info ][Logger] Model base rate : 0.2
>> 177.477 [ Info ][Logger] Number of sample times : 2
>> 177.477 [ Info ][Logger] Sample time 0 : 0
>> 177.477 [ Info ][Logger] Sample time 1 : 0.2
>> 177.477 [ Warning][Logger] Forcing base rate to : 0.1
>> 177.477 [ Info ][Logger] Setting port Input to 5
>> 177.477 [ Info ][Logger] DataPort Input is an INPUT port.
>> 177.477 [ Info ][Logger] Monitor inputs: 3
>> 177.477 [ Info ][Logger] Monitor outputs: 3
>> 177.478 [ Info ][Logger] Monitor params: 3
>> 177.478 [ Info ][Logger] Initialising port Monitor.
>> 177.478 [ Info ][Logger] Setting port Output to 0
>> 177.478 [ Info ][Logger] DataPort Output is an OUTPUT port.
>> true
>>
>> Note this statement succeeds (as do the commands on line 2 and 3 of the
>> program script). I obtain similar behaviour if the firstMode.configure()
>> statement is uncommented, and VERBOSE logger mode doesn't show anything
>> suspicious.
>>
>> What am I doing wrong here?
>
> Can you test the same sequence using valgrind ? It's such absurd behaviour...
> I'm guessing this is Simulink related and that configure() really returns
> false. The only place where this happens without logging a message is in:

I'll send you the output in a private mail (it's rather huge :-)
However, it also occurs if I take a component which is *not* generated
by simulink.

In Task Deployer[R]. (Status of last Command : busy )
(type 'ls' for context info) :list startup
1 program startup {
2 do loadComponents("deployment.cpf")
3 do configureComponents()
4 // do firstMode.configure()
5 // do secondMode.configure()
E> 6 do Adaptor.configure()
7 do Logical.start()
8 do Logical.LogicalStateMachine.activate()
9 }

In Task Deployer[R]. (Status of last Command : busy )
(type 'ls' for context info) :Adaptor.configure()
Got :Adaptor.configure()
= 72.934 [ Info ][PropertyLoader:configure] Configuring TaskContext
'Adaptor' with 'cpf/adaptor.cpf'.
true

And it's not configure() related either. Could it have something to
do with the deployer and its peer components (the commands that
succeed are interpreted by "this". I really guess it's me this time
:-))

Klaas

program script syntax issue?

On Thu, May 22, 2008 at 3:32 PM, Klaas Gadeyne <klaas [dot] gadeyne [..] ...> wrote:
> On Thu, May 22, 2008 at 3:01 PM, Peter Soetens

<peter [dot] soetens [..] ...> wrote:
>> On Thursday 22 May 2008 14:15:54 Klaas Gadeyne wrote:
>>> I have the following program script running in the deployment component
>>>
>>> program startup {
>>> do loadComponents("deployment.cpf")
>>> do configureComponents()
>>> // do firstMode.configure()
>>> do secondMode.configure()
>>> do adaptor.configure()
>>> do Logical.start()
>>> do Logical.LogicalStateMachine.activate()
>>> }
>>>
>>> However, when I run this program, it is not executed completely as I
>>> expect, indeed the first to statements are executed correctly, and then I
>>> get
[...]
> And it's not configure() related either. Could it have something to
> do with the deployer and its peer components (the commands that
> succeed are interpreted by "this". I really guess it's me this time
> :-))

Apologies to /self. You should really have more self-confidence Klaas!
For the interested users -> This appeared to be a bug, see

Klaas