Showing results for 
Search instead for 
Do you mean 
Reply

Calculating in Simulation-Layers

Hey guys,

is it possible to calculate with integers in simulation layers?

 

For example something like that:

 

<Line>
<Item Type="const"># WaitTime </Item>
<Item Type="parameter">Fraes_Impuls/3</Item>
</Line>

The solution above does not work. Smiley Wink Is this somehow possible or am I spoiled by other programming languages?

 

 

11 REPLIES

Re: Calculating in Simulation-Layers

<Line>
<Item Type="const"># SetVariable MyDelay</Item>
<Item Type="parameter">Fraes_Impuls</Item>
<Item Type="const"> / 3</Item> </Line>
<Line>
<Item Type="const"># WaitTime MyDelay</Item>
</Line>

should work

Re: Calculating in Simulation-Layers

Hmm, there are still problems:

The code looks like this:

 

<SimulationLayer>
   <If>
      <![CDATA[('Fraes_Impuls'>=0)]]>
      <Line>
         <Item Type="const"># SetVariable MyDelay</Item>
         <Item Type="parameter">Fraes_Impuls</Item>
         <Item Type="const">/ 3</Item>
      </Line>
      <Line>
         <Item Type="const"># WaitTime</Item>
         <Item Type="const">MyDelay</Item>
      </Line>
   </If>
</SimulationLayer>

I get the following error:

 

ir_110010r02[RRS]> Hinweis an (Wz1_Fraesen_Flanke) Fraes1_100: [DBG] OnLocationReached: 3,26591992378234
ir_110010r02[RRS]> Hinweis an (Wz1_Fraesen_Flanke) Fraes1_100: [DBG] # NotifyMovingToTargetEnded Fraes1_100
ir_110010r02[RRS]> Hinweis an (Wz1_Fraesen_Flanke) Fraes1_100: [DBG] NotifySimulationEvent MotionToLocation Fraes1_100: OFF (3,26591992378234ms)
ir_110010r02[RRS]> Hinweis an (Wz1_Fraesen_Flanke) Fraes1_100: [DBG] # SetVariable MyDelay 8 / 3
ir_110010r02[RRS]> Hinweis an (Wz1_Fraesen_Flanke) Fraes1_100: [DBG] # WaitTime MyDelay
ir_110010r02[RRS]> Interner Fehler an (Wz1_Fraesen_Flanke) Fraes1_100: SimulateWaitTimeStep2 - wrong parameter type
ir_110010r02[RRS]> Hinweis an (Wz1_Fraesen_Flanke) Fraes1_100: [DBG] # NotifyProcessingTargetEnded Fraes1_100

Still any ideas? Smiley Wink

Re: Calculating in Simulation-Layers

Okay, there are still problems:

 

ir_110010r02[RRS]> Hinweis an (Wz1_Fraesen_Flanke) Fraes1_100: [DBG] OnLocationReached: 5,78188786506654
ir_110010r02[RRS]> Hinweis an (Wz1_Fraesen_Flanke) Fraes1_100: [DBG] # NotifyMovingToTargetEnded Fraes1_100
ir_110010r02[RRS]> Hinweis an (Wz1_Fraesen_Flanke) Fraes1_100: [DBG] NotifySimulationEvent MotionToLocation Fraes1_100: OFF (5,78188786506654ms)
ir_110010r02[RRS]> Hinweis an (Wz1_Fraesen_Flanke) Fraes1_100: [DBG] # SetVariable MyDelay 8 / 3
ir_110010r02[RRS]> Hinweis an (Wz1_Fraesen_Flanke) Fraes1_100: [DBG] # WaitTime MyDelay
ir_110010r02[RRS]> Interner Fehler an (Wz1_Fraesen_Flanke) Fraes1_100: SimulateWaitTimeStep2 - wrong parameter type
ir_110010r02[RRS]> Hinweis an (Wz1_Fraesen_Flanke) Fraes1_100: [DBG] # NotifyProcessingTargetEnded Fraes1_100
ir_110010r02[RRS]> Hinweis an (Wz1_Fraesen_Flanke) Fraes1_100: [DBG] Notify ProcessingTargetEnded Fraes1_100

The code looks like this:

 

<SimulationLayer>
   <If>
      <![CDATA[('Fraes_Impuls'>=0)]]>
      <Line>
         <Item Type="const"># SetVariable MyDelay</Item>
         <Item Type="parameter">Fraes_Impuls</Item>
         <Item Type="const">/ 3</Item>
      </Line>
      <Line>
         <Item Type="const"># WaitTime</Item>
         <Item Type="const">MyDelay</Item>
      </Line>
   </If>
</SimulationLayer>

Any further ideas? Smiley Wink

Re: Calculating in Simulation-Layers

unfortunately not. Smiley Sad

 

 

ir_110010r02[RRS]> Hinweis an (Wz1_Fraesen_Flanke) Fraes1_100: [DBG] # NotifyMovingToTargetEnded Fraes1_100
ir_110010r02[RRS]> Hinweis an (Wz1_Fraesen_Flanke) Fraes1_100: [DBG] NotifySimulationEvent MotionToLocation Fraes1_100: OFF (5,78188786506654ms)
ir_110010r02[RRS]> Hinweis an (Wz1_Fraesen_Flanke) Fraes1_100: [DBG] # SetVariable MyDelay 8 / 3
ir_110010r02[RRS]> Hinweis an (Wz1_Fraesen_Flanke) Fraes1_100: [DBG] # WaitTime MyDelay
ir_110010r02[RRS]> Interner Fehler an (Wz1_Fraesen_Flanke) Fraes1_100: SimulateWaitTimeStep2 - wrong parameter type
ir_110010r02[RRS]> Hinweis an (Wz1_Fraesen_Flanke) Fraes1_100: [DBG] # NotifyProcessingTargetEnded Fraes1_100
ir_110010r02[RRS]> Hinweis an (Wz1_Fraesen_Flanke) Fraes1_100: [DBG] Notify ProcessingTargetEnded Fraes1_100

 

The code looks like this:

 

<SimulationLayer>
   <If>
      <![CDATA[('Fraes_Impuls'>=0)]]>
      <Line>
         <Item Type="const"># SetVariable MyDelay</Item>
         <Item Type="parameter">Fraes_Impuls</Item>
         <Item Type="const">/ 3</Item>
      </Line>
      <Line>
         <Item Type="const"># WaitTime</Item>
         <Item Type="const">MyDelay</Item>
      </Line>
   </If>
</SimulationLayer>

Any further ideas?

 

Re: Calculating in Simulation-Layers

Unfortunately not. :/

 

Now the code looks like this:

 

<SimulationLayer>
   <If>
      <![CDATA[('Fraes_Impuls'>=0)]]>
      <Line>
         <Item Type="const"># SetVariable MyDelay</Item>
         <Item Type="parameter">Fraes_Impuls</Item>
         <Item Type="const">/ 3</Item>
      </Line>
      <Line>
         <Item Type="const"># WaitTime</Item>
         <Item Type="const">MyDelay</Item>
      </Line>
   </If>
</SimulationLayer>

When I try to run the function, the trace throws an error:

 

ir_110010r02[RRS]> Hinweis an (Wz1_Fraesen_Flanke) Fraes1_100: [DBG] OnLocationReached: 7,03987183570865
ir_110010r02[RRS]> Hinweis an (Wz1_Fraesen_Flanke) Fraes1_100: [DBG] # NotifyMovingToTargetEnded Fraes1_100
ir_110010r02[RRS]> Hinweis an (Wz1_Fraesen_Flanke) Fraes1_100: [DBG] NotifySimulationEvent MotionToLocation Fraes1_100: OFF (7,03987183570865ms)
ir_110010r02[RRS]> Hinweis an (Wz1_Fraesen_Flanke) Fraes1_100: [DBG] # SetVariable MyDelay 8 / 3
ir_110010r02[RRS]> Hinweis an (Wz1_Fraesen_Flanke) Fraes1_100: [DBG] # WaitTime MyDelay
ir_110010r02[RRS]> Interner Fehler an (Wz1_Fraesen_Flanke) Fraes1_100: SimulateWaitTimeStep2 - wrong parameter type
ir_110010r02[RRS]> Hinweis an (Wz1_Fraesen_Flanke) Fraes1_100: [DBG] # NotifyProcessingTargetEnded Fraes1_100

Any further idea? Smiley Happy

Re: Calculating in Simulation-Layers

Unfortunately not. :/

Now the code looks like this:

[Code]
<SimulationLayer>
<If>
<![CDATA[('Fraes_Impuls'>=0)]]>
<Line>
<Item Type="const"># SetVariable MyDelay</Item>
<Item Type="parameter">Fraes_Impuls</Item>
<Item Type="const">/ 3</Item>
</Line>
<Line>
<Item Type="const"># WaitTime</Item>
<Item Type="const">MyDelay</Item>
</Line>
</If>
</SimulationLayer>
[/Code]

When I try to run the function, the trace throws an error:

[Code]
ir_110010r02[RRS]> Hinweis an (Wz1_Fraesen_Flanke) Fraes1_100: [DBG] OnLocationReached: 7,03987183570865
ir_110010r02[RRS]> Hinweis an (Wz1_Fraesen_Flanke) Fraes1_100: [DBG] # NotifyMovingToTargetEnded Fraes1_100
ir_110010r02[RRS]> Hinweis an (Wz1_Fraesen_Flanke) Fraes1_100: [DBG] NotifySimulationEvent MotionToLocation Fraes1_100: OFF (7,03987183570865ms)
ir_110010r02[RRS]> Hinweis an (Wz1_Fraesen_Flanke) Fraes1_100: [DBG] # SetVariable MyDelay 8 / 3
ir_110010r02[RRS]> Hinweis an (Wz1_Fraesen_Flanke) Fraes1_100: [DBG] # WaitTime MyDelay
ir_110010r02[RRS]> Interner Fehler an (Wz1_Fraesen_Flanke) Fraes1_100: SimulateWaitTimeStep2 - wrong parameter type
ir_110010r02[RRS]> Hinweis an (Wz1_Fraesen_Flanke) Fraes1_100: [DBG] # NotifyProcessingTargetEnded Fraes1_100
[/Code]

Any further idea? Smiley Happy

Re: Calculating in Simulation-Layers

Hi,

 

please check these thinks.

 

1.check function without "IF" condition

2. test function without Custom XML. Write the logic directly in OLP Commands

3. delete the empty letters <Item Type="const">/ 3</Item>

4. what is the data format from "MyDelay" ? INT?

 

 

 

Kind regards,

Benjamin Voelzke

Re: Calculating in Simulation-Layers

1. Done - no difference.
2. pending. Smiley Wink
3. Done - no difference.
4. Input is INT, but MyDelay could be float. (F.E. 10/3)
Why are you asking? Is it necessary to declare the variable?

Re: Calculating in Simulation-Layers

Hi,

 

i can reproduce your wish.

 

PS convert the # SetVariable MyDelay 8 / 3 to string not to INT.

 

Sorry in these case i have no idea.

 

Kind regards,

Benjamin Voelzke