ControlCoreServer:FAQ:How do I make a canDOR file tell ControlCoreServer to set the 'Enable All' or 'Simulate All' properties on the tree?

From MotoHawk
Jump to navigationJump to search

If you use ControlCoreServer to simulate CAN traffic, you are probably familiar with the menus that show up when you right-click a node on the SignalTree in ControlCoreServer. This menu gives you options like 'Enable All' and 'Simulate All'. It is through these options that you tell ControlCoreServer how you want the SignalProviders (folders in the tree) to behave. A SignalProvider can be disabled, enabled, or enabled and simulating. Disabled means dormant (not really doing anything yet), enabled generally means listening - decoding CAN messages for instance, enabled and simulating generally means sending messages. You will notice that the tree presents a hierarchical structure, or layout, of your SignalProviders and Signals. This structure is important. For a SignalProvider to be enabled, all of its parents must be enabled. A SignalProvider can only be simulating when enabled.

If you find yourself going through the same sequence of 'Enable All' and 'Simulate All' over and over you may be interested to know that you can have this done automatically for you when you load a canDOR file. You can ask ControlCoreServer to set the simulation configuration for the SignalProviders created when you load a file by adding a little xml snippet at the bottom of your canDOR file. Let's say you have a canDOR file that looks like this (some needless detail omitted):

<?xml version="1.0" encoding="ISO-8859-1"?>
<PROJECT>
 <NAME>EngineCANTraffic</NAME>
 <DESCRIPTION />
 <BUS>
  <NAME>CAN_1</NAME>
  <BAUD_RATE>250000</BAUD_RATE>
  <NODE>
   <NAME>STBD</NAME>
   <DESCRIPTION>Standard STBD engine.</DESCRIPTION>
   <IMAGE>.\ECU555-80.jpg</IMAGE>
   <CHANNEL>1</CHANNEL>
   <GROUP>
    <NAME>PCMT2</NAME>
    <DESCRIPTION>Medium Speed Engine Data</DESCRIPTION>
    <CODEC TYPE="FixedContentCodec">
     <NAME>Page0</NAME>
      <...Details Omitted...>
    </CODEC>
   </GROUP>
  </NODE>
 </BUS>
</PROJECT>


This file would set up a tree in ControlCoreServer that looks like this:

Ccs Tree.jpg


The Page0 you see in the picture above is a SignalProvider, its full name is 'STBD.PCMT2.Page0'. To automatically set the STBD.PCMT2.Page0 SignalProvider to listen to messages (be enabled) you could add a node like the following at bottom between <BUS> and <PROJECT>:

<simulation_config>
 <node name="STBD" enableall="true" />
</simulation_config>

Your file would look like this:

 <...Details Omitted...>
    </CODEC>
   </GROUP>
  </NODE>
 </BUS> 
 <simulation_config>
  <node name="STBD" enableall="true" />
 </simulation_config>
</PROJECT>

To set the whole tree below STBD to send messages (enabled and simulated) you would add the following node.

<simulation_config>
 <node name="STBD" enableall="true" simulateall="true"/>
</simulation_config>

If you only wanted to have the SignalProvider named STBD.PCMT2 and all its children send messages, you might add something that looks like:

<simulation_config>
 <node name="STBD" enableall="true"/>
 <node name="STBD.PCMT2" simulateall="true"/>
</simulation_config>

Notice in this case that <node name="STBD" enableall="true"/> enables the whole tree under STBD, then the <node name="STBD.PCMT2" simulateall="true"/> sets that specific SignalProvider and its children to be simulating.


The options are:

  • enable - this sets only the named SignalProvider to be enabled.
  • enableall - this sets the named SignalProvider and all its children to be enabled.
  • simulate - this sets only the named SignalProvider to be simulated (if enabled).
  • simulateall - this sets the named SignalProvider and all its children to be simulated (if enabled).

Using combinations of these options, you can set the initial state of the tree automatically as opposed to going through a right-click sequence.


Back to ControlCoreServer:FAQ