Setting up LabVIEW RT VIs
Example.vi is the top-most LabVIEW VI block, the front panel of which contains the form to input the CCP configuration. This configuration window is array of CCP Config.ctl a typedef to contain all necessary info. If more than one CCP connection (‘stack) needs to be configured, the array size can be incremented by pressing the numeric up-down control on the left of the control. |
Name: is used to distinguish the CCP connection (this name is also used as a name of the transform in MxTransit and to append to transform default ports like CCP_Connect and CCP_Config.) BusId: specifies which CAN bus (port) to send CAN messages on associated with this CCP stack TxId: is CRO - Command Receive Object : message sent from the master device to the slave device. RxId: is DTO - Data Transmission Object : message sent from the slave device to the master device (Command Return Message or Event Message or Data Acquisition Message). big-Endian and Extended: are Boolean flags to specify device endianness and extended addressing. StationId: station address of slave device. |
This configuration fed as an input to the MxEnumerateIO.vi sub-vi. A for-loop executes N times depending on the size of the configuration array, and call MxAddCCP.vi which is set up to call the MxLV_EnumAddCCP function inside LabviewRT.dll
int32_t _MxLV_EnumAddCCP(CStr name, uint32_t busId, uint32_t txId, uint32_t rxId, uint8_t bigEndian, uint8_t extended, uint16_t stationId);
|
Setting Up a Test in MxSuite
When devices are enumerated in MxTransit, configured CCP stacks appear with a separate transform in the transform web graph. The transform name and parameters should reflect the settings configured in LabVIEW VIs.
Transform properties provide further configuration for the CCP stack: A2L file: is used to define signals that to be used during the test. Either paste the file path to the A2L file or use file browser to browse to it. Ideally the A2L file should be located within the MxVDev project directory, which allows for proper storage of the relative file path to re-load later, or to allow the project folder to be moved from one drive to another. Pick Signals: brings up a dialog where all of the signals from the a2l file are shown and user can select which signals to use during testing. Select as many signals as necessary for the test. By default, all signals are set to be Input signals (input to the SUT), to change a signal to an output, after selected signals are on the right side of the form, double-click on the signal and select Output under the Data Flow property. When you pick A2L signals in MxTransIt, it stores the A2L time stamp to check against later. Whenever the MxVDev project is loaded, or Connect Test Harness in MxVDev is pressed, it checks the time that A2L was checked last. If the time stamp on the file is different, it updates addresses and scaling that are loaded in memory by CCP transform. Default signals CCP_Config, CCP_Connect, and CCP_Ready are used to set and run the test: •CCP_Config: is used to configure which output signals in the transform to "instrument" for the particular test scenario. •CCP_Connect: is used to send a command to the CCP driver to initialize and start communication with slave device. •CCP_Ready: is used to signal to the test environment that communication was established and the test has started. The transform name is appended to the end of the default signals to distinguish the signal if there is more than one CCP transform. After all the desired signals have been added to the transform, the ports on the transform should be exported so they are visible to MxVDev and can be used to set up and run the test. |
To set up test in MxVDev, the 3 default signals (CCP_Config, CCP_Connect and CCP_Ready) should be added to the test case, along with any input and output signals. CCP_Config is used to configure which CCP signals are monitored during the test. Ideally it should be done only once during the test and configuration should happen before the command to connect on CCP_Connect is sent. Double-click in the test case on the editor for the CCP_Config signal to create a transition. The editor for the signal has 4 columns, and one row for every output signal in the CCP transform. In Instrument column, put a check mark to indicate that this signal is used during the test. The Type column specifies the type of the output: •DAQ - instruments the signals for CCP DAQ acquisition •Poll – instruments the signal for periodic polling The Poll Rate column specifies the rate at which signal will be polled for Poll mode or DAQ prescaler for DAQ mode. When CCP_Connect transitions from 0 to 1, it signals the CCP driver to initialize and start communication with a slave device; a transition from 1 to 0 tells it to stop and disconnect. CCP_Ready is an output signal (response from the SUT) that transitions from 0 to 1 when communication is established and the test has started. If two CCP connections are used, a second set of CCP_Config, CCP_Connect and CCP_Ready must be added to the test case and set up in the similar way. |