|
FreeHIL
|
FreeHIL allows you to develop a sophisticated Hardware In the Loop (HIL) simulator using available tools like evaluation boards.
| Component | Version |
|---|---|
| Base Project | v1.1.0 |
| RobotFramework Source Code | v1.1.0 |
| Embedded Software Source Code | v1.1.0 |
This project is licensed under the Apache License, Version 2.0.
For the full legal text, please see the LICENSE file in the repository.
Copyright 2026 Vahid Hasirchi
Here are the video guides for this project. Click the thumbnails to watch directly on YouTube:
This is the base FreeHIL repository containing the core logic of FreeHIL Embedded Software + Robot Framework Source Code
View Base Repo on GitHubThese repositories contain the FreeHIL core logic ported to specific IDEs and MCUs.
Initial porting of v1.1.0 in progress...
Initial porting of v1.1.0 in progress...
Initial porting of v1.1.0 in progress...
Initial porting of v1.1.0 in progress...
There are different types of Verification and Validation in the Product Life Cycle (PLC) of Embedded Systems.
Test Automation is crucial for both processes. Using frameworks like RobotFramework, you can execute test cases without human intervention.
The FH package is composed of 2 main parts:
==============================================================================
##### RobotFramework Example #####
==============================================================================
@{MessageData} = Create List ${DO01} ${DO_Set}
&{Message} = Create Dictionary DeviceAddress=${DeviceAddress_01}
Function=${Function_DO} Command=${DO_Commands_SetStatus}
Data=@{MessageData}
${Result} SendMessage &{Message}
The source code includes three main directories:
This directory handles peripherals like Digital I/O (up to 64 channels), Analog I/O, PWM, UART, and CAN. Users should look for "Attentions" in the comments of files (e.g., FH_DO02.c) to find where to insert their specific driver code.
/** * @file * @brief * <b>File Map:</b>\n * <b>FH_Functions</b>, Section <b>FH_DO</b> (Digital Output), Peripheral <b>FH_DO02</b> (Digital Output 02)\n * (The <b>DO02 (Digital Output 02)</b> could be any interested digital output of the micro-controller on which <b>FH</b> source code is ported)\n * * @note To have a clean code, <b>FH</b> user should have the implementation of the initialization, set and reset functions of the <b>Digital Output 02</b> in a separate c file\n * Then <b>FH</b> user should include the header file <b>(.h)</b> of the related source file <b>(.c)</b> here\n * This header file shall include the following items:\n * The declaration of the initialization function of the <b>Digital Output 02</b>\n * The declaration of the set and reset functions of the <b>Digital Output 02</b> * * @attention There are a total number of <b>4 attentions</b> (<b>FH</b> user defined code) in this file where <b>FH</b> user shall insert some code\n * Other parts could be left intact * ******************************************************************************* * SPDX-License-Identifier: Apache-2.0 * * Copyright 2026 [Vahid Hasirchi] * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************** * @author Vahid Hasirchi (vahid.hasirchi@gmail.com) * * <b>For more information refer to FreeHIL.com</b> * */
And it indicates that there are 4 attentions in FH_DO02.c file
And these attentions are as following:
Attention 1 in FH_DO02.c file:
Attention 2 in FH_DO02.c file:
Attention 3 and Attention 4 in FH_DO02.c file:
This directory includes the following directories:
1 - FH_General
2 - FH_Perif
This directory includes the following directories:
1 - FH_ErrorInfo (Error Information)
To monitor different possible errors in different parts of the code
2 - FH_GeneralFunctions (General Functions)
All different possible general functions utilized in different parts of the code, go here
3 - FH_GlobalTimerCount (Global Timer Counter)
There are a diverse range of different situations where a precise timing is a necessity To have a general heart beat (1 millisecond) for all different parts of the code, a timer in the micro-controller on which FH source code is ported, shall be utilized FH_GlobalTimeCounter here shall be incremented every 1 millisecond in an interested timer ISR (Interrupt Service Routine) by FH user For this to happen, FH_GlobalTimerCount.h shall be included in the interested timer ISR (Interrupt Service Routine) file
Here is an example of handling FH_GlobalTimeCounter in the Timer 4 of STM32CubeIDE with STM32H7B0VBT6 microcontroller:
This directory includes the following directories:
1 - FH_DO (Digital Output)
Including Cmd (commands) and FH_DO_Configs (Configurations) directories and also FH_DO.c and FH_DO.h files, To handle commands related to DO01 (Digital Output 01) to DO64 (Digital Output 64)
2 - FH_DI (Digital Input)
Including Cmd (commands) and FH_DI_Configs (Configurations) directories and also FH_DI.c and FH_DI.h files, To handle commands related to DI01 (Digital Input 01) to DI64 (Digital Input 64)
3 - FH_AO (Analog Output)
Including Cmd (commands) and FH_AO_Configs (Configurations) directories and also FH_AO.c and FH_AO.h files, To handle commands related to AO01 (Analog Output 01) to AO64 (Analog Output 64)
4 - FH_AI (Analog Input)
Including Cmd (commands) and FH_AI_Configs (Configurations) directories and also FH_AI.c and FH_AI.h files, To handle commands related to AI01 (Analog Input 01) to AI64 (Analog Input 64)
5 - FH_PWMO (PWM Output)
Including Cmd (commands) and FH_PWMO_Configs (Configurations) directories and also FH_PWMO.c and FH_PWMO.h files, To handle commands related to PWMO01 (PWM Output 01) to PWMO64 (PWM Output 64)
6 - FH_PWMI (PWM Input)
Including Cmd (commands) and FH_PWMI_Configs (Configurations) directories and also FH_PWMI.c and FH_PWMI.h files, To handle commands related to PWMI01 (PWM Input 01) to PWMI64 (PWM Input 64)
7 - FH_UART (UART)
Including Cmd (commands) and FH_UART_Configs (Configurations) directories and also FH_UART.c and FH_UART.h files, To handle commands related to UART01 (UART 01) to UART08 (UART 08)
8 - FH_CAN (CAN)
Including Cmd (commands) and FH_CAN_Configs (Configurations) directories and also FH_CAN.c and FH_CAN.h files, To handle commands related to CAN01 (CAN 01) to CAN08 (CAN 08)
This directory includes the following directories:
1 - FH_DeviceAddress
2 - FH_DevicePeripherals
3 - FH_RFCommunication
Including FH_DeviceAddress.h (Device Address) file, To set the device (or card) address here
The micro-controller on which FH source code is ported, could be simply utilized in a RS485 network
In other words, multiple devices or multiple cards could be simply utilized where every device or every card has its own address
Address of the device (or card) for every device (or card) is set here
Including FH_DevicePeripherals.h (Device Peripherals) file, To set the the maximum number of peripherals for interested HIL Simulator here
Including the following files: FH_RFCommunication_Configs.h (RobotFramework Communication Configuration) FH_RFCommunication_GlobalVariables.h (RobotFramework Communication Global Variables) FH_RFCommunication.c (RobotFramework Communication) FH_RFCommunication.h (RobotFramework Communication) To handle the communication between RobotFramework and the micro-controller on which FH source code is ported
The micro-controller on which FH source code is ported, could be simply utilized in a RS485 network
In other words, multiple devices or multiple cards could be simply utilized where every device or every card has its own address
Address of the device (or card) for every device (or card) is set by FH user in FH_DeviceAddress.h
An interested UART (called Communication Dedicated UART) by the FH user for the communication between RobotFramework and the micro-controller on which FH source code is ported, shall be dedicated
Attention 1 in FH_RFCommunication.c file:
Attention 2 in FH_RFCommunication.c file:
Attention 3 in FH_RFCommunication.c file:
Here is an example of handling FH_RFCommunication_ReceiveBuf and FH_RFCommunication_ReceiveBufIndex of the Communication Dedicated UART in the UART 1 of STM32H7B0VBT6 microcontroller:
There are 2 main directories in FH RobotFramework source code (FH_RobotFramework) as following:
1 - FH_Resources
Including FH_Keywords.robot file and FH_MessageSetting.robot file
FH_Keywords.robot:
Just the SendMessage function used in TestCategoty1.robot file is defined here as keyword
FH_MessageSetting.robot:
Just the variables used in TestCategoty1.robot file are defined here (like ${ERROR_NoInfo},${DeviceAddress_01},{Function_DO},${DO_Commands_Init},....)
2 - FH_TestSuites
Including TestSuite1 (Test suite 1) directory which includes TestCategoty1.robot file TestCategoty1.robot: This is the main file where the FH user (who wants to develop a HIL simulator) could write test cases
FH RobotFramework source code utilizes the Serial library in RobotFramework
The FH user (who wants to develop a HIL simulator) could simply send different messages to the microcontroller on which FH Embedded Software source code is ported and verify the result too
Here is an example of setting the Digital Output Number 01 of an interested microcontroller to logic 1 (Set):
==============================================================================
##### RobotFramework Example #####
==============================================================================
@{MessageData} = Create List ${DO01} ${DO_Set}
&{Message} = Create Dictionary DeviceAddress=${DeviceAddress_01} Function=${Function_DO} Command=${DO_Commands_SetStatus} Data=@{MessageData}
${Result} SendMessage &{Message}
Comments:
DO01 => It indicates the Digital Output 01
DO_Set => It indicates the Digital Output 01 shall be Set (DO_Reset indicates the Digital Output 01 shall be Reset)
DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
Function_DO => It is the function in the message frame
DO_Commands_SetStatus => It is the command of the function in the message frame
The following HIL simulator's peropherals are supported:
1 - Up to 64 Digital Output
2 - Up to 64 Digital Input
3 - Up to 64 Analog Output
4 - Up to 64 Analog Input
5 - Up to 64 PWM Output
6 - Up to 64 PWM Input
7 - Up to 8 UART (TX/RX)
8 - Up to 8 CAN (TX/RX)
Message | Description |
|---|---|
| DO_Commands_Init | Initializes a DO (Digital Output) |
| DO_Commands_SetStatus | Sets the status of a DO (Digital Output) to 1 or 0 |
| DO_Commands_InitMULTI | Initializes up to 64 DO (Digital Output) |
| DO_Commands_SetStatusMULTI | Sets the status of up to 64 DO (Digital Output) |
This command initializes a DO (Digital Output)
This command may invoke FH_DO_Init_DO01 to FH_DO_Init_DO64
| Send Message Body | Description |
|---|---|
| DeviceAddress | It shall be equal to the address of the device (FH_RFCommunication_DeviceAddress) |
| Function | Function_DO (0x00) |
| Command | DO_Commands_Init (0x00) |
| MessageDataLength | 1 byte (0x01) |
| MessageData | Digital Output Number (0x01 for DO01 to 0x40 for DO64) |
| Checksum | Sum of all the bytes (For user-friendly design purposes, not implemented => always 0xAA) |
| Result Message Body | Description |
|---|---|
| DeviceAddress (2 bytes) | Ascii equivalent of the hex address of the device (FH_RFCommunication_DeviceAddress) |
| Function (2 bytes) | "DO" |
| Command (4 bytes) | "Init" |
| MessageData (2 bytes) | Ascii equivalent of the hex value of the Error Code (XX) in FH_ErrorInfo.h |
==============================================================================
##### RobotFramework Example #####
==============================================================================
@{MessageData} = Create List ${DO01}
&{Message} = Create Dictionary DeviceAddress=${DeviceAddress_01} Function=${Function_DO} Command=${DO_Commands_Init} Data=@{MessageData}
${Result} SendMessage &{Message}
Log Many Result = ${Result}
@{ResultComponents}= split string ${Result} |
Log Many DeviceAddress = ${ResultComponents}[0]
Log Many Function = ${ResultComponents}[1]
Log Many Command = ${ResultComponents}[2]
Log Many ErrorInformation = ${ResultComponents}[3]
Should Be Equal ${ResultComponents}[0] 01
Should Be Equal ${ResultComponents}[1] DO
Should Be Equal ${ResultComponents}[2] Init
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo}
Comments:
DO01 => It indicates the Digital Output 01
DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
Function_DO => It is the function in the message frame
DO_Commands_Init => It is the command of the function in the message frame
Result Example:
Log Many Result = ${Result} => 01|DO|Init|00|
@{ResultComponents}= split string ${Result} | => Split the result elements string by |
Log Many DeviceAddress = ${ResultComponents}[0] => DeviceAddress = 01
Log Many Function = ${ResultComponents}[1] => Function = DO
Log Many Command = ${ResultComponents}[2] => Command = Init
Log Many ErrorInformation = ${ResultComponents}[3] => ErrorInformation = 00 (ERROR_NoInfo)
Should Be Equal ${ResultComponents}[0] 01 => If ${ResultComponents}[0] (DeviceAddress) is not equal to "01" then the test is not passed
Should Be Equal ${ResultComponents}[1] DO => If ${ResultComponents}[1] (Function) is not equal to "DO" then the test is not passed
Should Be Equal ${ResultComponents}[2] Init => If ${ResultComponents}[2] (Command) is not equal to "Init" then the test is not passed
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo} => If ${ResultComponents}[3] (ErrorInformation) is not equal to "${ERROR_NoInfo} (00)" then the test is not passed
This command sets the status of a DO (Digital Output) to 1 or 0
This command may invoke FH_DO_SetStatus_DO01 to FH_DO_SetStatus_DO64
| Send Message Body | Description |
|---|---|
| DeviceAddress | It shall be equal to the address of the device (FH_RFCommunication_DeviceAddress) |
| Function | Function_DO (0x00) |
| Command | DO_Commands_SetStatus (0x01) |
| MessageDataLength | 2 bytes (0x02) |
| MessageData1 | Digital Output Number (0x01 for Digital Output Number 01 to 0x40 for Digital Output Number 64) |
| MessageData2 | DO_Set (0x01 for status as 1) or DO_Reset (0x00 to set status as 0) |
| Checksum | Sum of all the bytes (For user-friendly design purposes, not implemented => always 0xAA) |
| Result Message Body | Description |
|---|---|
| DeviceAddress (2 bytes) | Ascii equivalent of the hex address of the device (FH_RFCommunication_DeviceAddress) |
| Function (2 bytes) | "DO" |
| Command (9 bytes) | "SetStatus" |
| MessageData (2 bytes) | Ascii equivalent of the hex value of the Error Code (XX) in FH_ErrorInfo.h |
==============================================================================
##### RobotFramework Example #####
==============================================================================
@{MessageData} = Create List ${DO01} ${DO_Set}
&{Message} = Create Dictionary DeviceAddress=${DeviceAddress_01} Function=${Function_DO} Command=${DO_Commands_SetStatus} Data=@{MessageData}
${Result} SendMessage &{Message}
Log Many Result = ${Result}
@{ResultComponents}= split string ${Result} |
Log Many DeviceAddress = ${ResultComponents}[0]
Log Many Function = ${ResultComponents}[1]
Log Many Command = ${ResultComponents}[2]
Log Many ErrorInformation = ${ResultComponents}[3]
Should Be Equal ${ResultComponents}[0] 01
Should Be Equal ${ResultComponents}[1] DO
Should Be Equal ${ResultComponents}[2] SetStatus
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo}
Comments:
DO01 => It indicates the Digital Output 01
DO_Set => It indicates the Digital Output 01 shall be Set (DO_Reset indicates the Digital Output 01 shall be Reset)
DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
Function_DO => It is the function in the message frame
DO_Commands_SetStatus => It is the command of the function in the message frame
Result Example:
Log Many Result = ${Result} => 01|DO|SetStatus|00|
@{ResultComponents}= split string ${Result} | => Split the result elements string by |
Log Many DeviceAddress = ${ResultComponents}[0] => DeviceAddress = 01
Log Many Function = ${ResultComponents}[1] => Function = DO
Log Many Command = ${ResultComponents}[2] => Command = SetStatus
Log Many ErrorInformation = ${ResultComponents}[3] => ErrorInformation = 00 (ERROR_NoInfo)
Should Be Equal ${ResultComponents}[0] 01 => If ${ResultComponents}[0] (DeviceAddress) is not equal to "01" then the test is not passed
Should Be Equal ${ResultComponents}[1] DO => If ${ResultComponents}[1] (Function) is not equal to "DO" then the test is not passed
Should Be Equal ${ResultComponents}[2] SetStatus => If ${ResultComponents}[2] (Command) is not equal to "SetStatus" then the test is not passed
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo} => If ${ResultComponents}[3] (ErrorInformation) is not equal to "${ERROR_NoInfo} (00)" then the test is not passed
This command initializes up to 64 DO (Digital Output)
This command may invoke FH_DO_Init_DO01 to FH_DO_Init_DO64
| Send Message Body | Description |
|---|---|
| DeviceAddress | It shall be equal to the address of the device (FH_RFCommunication_DeviceAddress) |
| Function | Function_DO (0x00) |
| Command | DO_Commands_InitMULTI (0x02) |
| MessageDataLength | 8 bytes (0x08) |
| MessageData1 | Digital Output Number Byte 1 for DO01 to DO08 (Example:0x82 => DO01 and DO07 should be initialized) |
| MessageData2 | Digital Output Number Byte 2 for DO09 to DO16 (Example:0x82 => DO09 and DO15 should be initialized) |
| MessageData3 | Digital Output Number Byte 3 for DO17 to DO24 (Example:0x82 => DO17 and DO23 should be initialized) |
| MessageData4 | Digital Output Number Byte 4 for DO25 to DO32 (Example:0x82 => DO25 and DO31 should be initialized) |
| MessageData5 | Digital Output Number Byte 5 for DO33 to DO40 (Example:0x82 => DO33 and DO39 should be initialized) |
| MessageData6 | Digital Output Number Byte 6 for DO41 to DO48 (Example:0x82 => DO41 and DO47 should be initialized) |
| MessageData7 | Digital Output Number Byte 7 for DO49 to DO56 (Example:0x82 => DO49 and DO55 should be initialized) |
| MessageData8 | Digital Output Number Byte 8 for DO57 to DO64 (Example:0x82 => DO57 and DO63 should be initialized) |
| Checksum | Sum of all the bytes (For user-friendly design purposes, not implemented => always 0xAA) |
| Result Message Body | Description |
|---|---|
| DeviceAddress (2 bytes) | Ascii equivalent of the hex address of the device (FH_RFCommunication_DeviceAddress) |
| Function (2 bytes) | "DO" |
| Command (9 bytes) | "InitMULTI" |
| MessageData (2 bytes) | Ascii equivalent of the hex value of the Error Code (XX) in FH_ErrorInfo.h |
==============================================================================
##### RobotFramework Example #####
==============================================================================
@{MessageData} = Create List FF FF FF FF FF FF FF FF
&{Message} = Create Dictionary DeviceAddress=${DeviceAddress_01} Function=${Function_DO} Command=${DO_Commands_InitMULTI} Data=@{MessageData}
${Result} SendMessage &{Message}
@{ResultComponents}= split string ${Result} |
Log Many DeviceAddress = ${ResultComponents}[0]
Log Many Function = ${ResultComponents}[1]
Log Many Command = ${ResultComponents}[2]
Log Many ErrorInformation = ${ResultComponents}[3]
Should Be Equal ${ResultComponents}[0] 01
Should Be Equal ${ResultComponents}[1] DO
Should Be Equal ${ResultComponents}[2] InitMULTI
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo}
Comments:
FF FF FF FF FF FF FF FF => Example data as the first 8 parameters of the Data in the message frame utilized as mask (In this example it means all 64 digital outputs shall be initialized)
DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
Function_DO => It is the function in the message frame
DO_Commands_InitMULTI => It is the command of the function in the message frame
Result Example:
Log Many Result = ${Result} => 01|DO|InitMULTI|00|
@{ResultComponents}= split string ${Result} | => Split the result elements string by |
Log Many DeviceAddress = ${ResultComponents}[0] => DeviceAddress = 01
Log Many Function = ${ResultComponents}[1] => Function = DO
Log Many Command = ${ResultComponents}[2] => Command = InitMULTI
Log Many ErrorInformation = ${ResultComponents}[3] => ErrorInformation = 00 (ERROR_NoInfo)
Should Be Equal ${ResultComponents}[0] 01 => If ${ResultComponents}[0] (DeviceAddress) is not equal to "01" then the test is not passed
Should Be Equal ${ResultComponents}[1] DO => If ${ResultComponents}[1] (Function) is not equal to "DO" then the test is not passed
Should Be Equal ${ResultComponents}[2] InitMULTI => If ${ResultComponents}[2] (Command) is not equal to "InitMULTI" then the test is not passed
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo} => If ${ResultComponents}[3] (ErrorInformation) is not equal to "${ERROR_NoInfo} (00)" then the test is not passed
This command sets the status of up to 64 DO (Digital Output)
This command may invoke FH_DO_SetStatus_DO01 to FH_DO_SetStatus_DO64
| Send Message Body | Description |
|---|---|
| DeviceAddress | It shall be equal to the address of the device (FH_RFCommunication_DeviceAddress) |
| Function | Function_DO (0x00) |
| Command | DO_Commands_SetStatusMULTI (0x03) |
| MessageDataLength | 16 bytes (0x10) |
| MessageData1 | Digital Output Number Mask Byte 1 for DO01 to DO08 (Example:0x82 => DO01 and DO07 should be set or reset) |
| MessageData2 | Digital Output Number Mask Byte 2 for DO09 to DO16 (Example:0x82 => DO09 and DO15 should be set or reset) |
| MessageData3 | Digital Output Number Mask Byte 3 for DO17 to DO24 (Example:0x82 => DO17 and DO23 should be set or reset) |
| MessageData4 | Digital Output Number Mask Byte 4 for DO25 to DO32 (Example:0x82 => DO25 and DO31 should be set or reset) |
| MessageData5 | Digital Output Number Mask Byte 5 for DO33 to DO40 (Example:0x82 => DO33 and DO39 should be set or reset) |
| MessageData6 | Digital Output Number Mask Byte 6 for DO41 to DO48 (Example:0x82 => DO41 and DO47 should be set or reset) |
| MessageData7 | Digital Output Number Mask Byte 7 for DO49 to DO56 (Example:0x82 => DO49 and DO55 should be set or reset) |
| MessageData8 | Digital Output Number Mask Byte 8 for DO57 to DO64 (Example:0x82 => DO57 and DO63 should be set or reset) |
| MessageData9 | Digital Output Number Status Byte 1 for DO01 to DO08 (Example:0x80 => DO01 should be set and DO07 should be reset) |
| MessageData10 | Digital Output Number Status Byte 2 for DO09 to DO16 (Example:0x80 => DO09 should be set and DO15 should be reset) |
| MessageData11 | Digital Output Number Status Byte 3 for DO17 to DO24 (Example:0x80 => DO17 should be set and DO23 should be reset) |
| MessageData12 | Digital Output Number Status Byte 4 for DO25 to DO32 (Example:0x80 => DO25 should be set and DO31 should be reset) |
| MessageData13 | Digital Output Number Status Byte 5 for DO33 to DO40 (Example:0x80 => DO33 should be set and DO39 should be reset) |
| MessageData14 | Digital Output Number Status Byte 6 for DO41 to DO48 (Example:0x80 => DO41 should be set and DO47 should be reset) |
| MessageData15 | Digital Output Number Status Byte 7 for DO49 to DO56 (Example:0x80 => DO49 should be set and DO55 should be reset) |
| MessageData16 | Digital Output Number Status Byte 8 for DO57 to DO64 (Example:0x80 => DO57 should be set and DO63 should be reset) |
| Checksum | Sum of all the bytes (For user-friendly design purposes, not implemented => always 0xAA) |
| Result Message Body | Description |
|---|---|
| DeviceAddress (2 bytes) | Ascii equivalent of the hex address of the device (FH_RFCommunication_DeviceAddress) |
| Function (2 bytes) | "DO" |
| Command (14 bytes) | "SetStatusMULTI" |
| MessageData (2 bytes) | Ascii equivalent of the hex value of the Error Code (XX) in FH_ErrorInfo.h |
==============================================================================
##### RobotFramework Example #####
==============================================================================
@{MessageData} = Create List FF FF FF FF FF FF FF FF 01 02 03 04 05 06 07 08
&{Message} = Create Dictionary DeviceAddress=${DeviceAddress_01} Function=${Function_DO} Command=${DO_Commands_SetStatusMULTI} Data=@{MessageData}
${Result} SendMessage &{Message}
@{ResultComponents}= split string ${Result} |
Log Many DeviceAddress = ${ResultComponents}[0]
Log Many Function = ${ResultComponents}[1]
Log Many Command = ${ResultComponents}[2]
Log Many ErrorInformation = ${ResultComponents}[3]
Should Be Equal As Strings ${ResultComponents}[0] 01
Should Be Equal ${ResultComponents}[1] DO
Should Be Equal ${ResultComponents}[2] SetStatusMULTI
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo}
Comments:
FF FF FF FF FF FF FF FF => Example data as the first 8 parameters of the Data in the message frame utilized as mask (In this example it means all 64 digital outputs shall set status)
01 02 03 04 05 06 07 08 => Example data as the second 8 parameters of the Data in the message frame as data value of 1 or 0, corresponding to the first 8 bytes)
DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
Function_DO => It is the function in the message frame
DO_Commands_SetStatusMULTI => It is the command of the function in the message frame
Result Example:
Log Many Result = ${Result} => 01|DO|SetStatusMULTI|00|
@{ResultComponents}= split string ${Result} | => Split the result elements string by |
Log Many DeviceAddress = ${ResultComponents}[0] => DeviceAddress = 01
Log Many Function = ${ResultComponents}[1] => Function = DO
Log Many Command = ${ResultComponents}[2] => Command = SetStatusMULTI
Log Many ErrorInformation = ${ResultComponents}[3] => ErrorInformation = 00 (ERROR_NoInfo)
Should Be Equal ${ResultComponents}[0] 01 => If ${ResultComponents}[0] (DeviceAddress) is not equal to "01" then the test is not passed
Should Be Equal ${ResultComponents}[1] DO => If ${ResultComponents}[1] (Function) is not equal to "DO" then the test is not passed
Should Be Equal ${ResultComponents}[2] SetStatusMULTI => If ${ResultComponents}[2] (Command) is not equal to "SetStatusMULTI" then the test is not passed
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo} => If ${ResultComponents}[3] (ErrorInformation) is not equal to "${ERROR_NoInfo} (00)" then the test is not passed
Message | Description |
|---|---|
| DI_Commands_Init | Initializes a DI (Digital Input) |
| DI_Commands_GetStatus | Gets the status of a DI (Digital Input) as 1 or 0 |
| DI_Commands_InitMULTI | Initializes up to 64 DI (Digital Input) |
| DI_Commands_GetStatusMULTI | Gets the status of up to 64 DI (Digital Input) |
This command initializes a DI (Digital Input)
This command may invoke FH_DI_Init_DI01 to FH_DI_Init_DI64
| Send Message Body | Description |
|---|---|
| DeviceAddress | It shall be equal to the address of the device (FH_RFCommunication_DeviceAddress) |
| Function | Function_DI (0x01) |
| Command | DI_Commands_Init (0x00) |
| MessageDataLength | 1 byte (0x01) |
| MessageData | Digital Input Number (0x01 for DI01 to 0x40 for DI64) |
| Checksum | Sum of all the bytes (For user-friendly design purposes, not implemented => always 0xAA) |
| Result Message Body | Description |
|---|---|
| DeviceAddress (2 bytes) | Ascii equivalent of the hex address of the device (FH_RFCommunication_DeviceAddress) |
| Function (2 bytes) | "DI" |
| Command (4 bytes) | "Init" |
| MessageData (2 bytes) | Ascii equivalent of the hex value of the Error Code (XX) in FH_ErrorInfo.h |
==============================================================================
##### RobotFramework Example #####
==============================================================================
@{MessageData} = Create List ${DI01}
&{Message} = Create Dictionary DeviceAddress=${DeviceAddress_01} Function=${Function_DI} Command=${DI_Commands_Init} Data=@{MessageData}
${Result} SendMessage &{Message}
Log Many Result = ${Result}
@{ResultComponents}= split string ${Result} |
Log Many DeviceAddress = ${ResultComponents}[0]
Log Many Function = ${ResultComponents}[1]
Log Many Command = ${ResultComponents}[2]
Log Many ErrorInformation = ${ResultComponents}[3]
Should Be Equal ${ResultComponents}[0] 01
Should Be Equal ${ResultComponents}[1] DI
Should Be Equal ${ResultComponents}[2] Init
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo}
Comments:
DI01 => It indicates the Digital Input 01
DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
Function_DI => It is the function in the message frame
DI_Commands_Init => It is the command of the function in the message frame
Result Example:
Log Many Result = ${Result} => 01|DI|Init|00|
@{ResultComponents}= split string ${Result} | => Split the result elements string by |
Log Many DeviceAddress = ${ResultComponents}[0] => DeviceAddress = 01
Log Many Function = ${ResultComponents}[1] => Function = DI
Log Many Command = ${ResultComponents}[2] => Command = Init
Log Many ErrorInformation = ${ResultComponents}[3] => ErrorInformation = 00 (ERROR_NoInfo)
Should Be Equal ${ResultComponents}[0] 01 => If ${ResultComponents}[0] (DeviceAddress) is not equal to "01" then the test is not passed
Should Be Equal ${ResultComponents}[1] DI => If ${ResultComponents}[1] (Function) is not equal to "DI" then the test is not passed
Should Be Equal ${ResultComponents}[2] Init => If ${ResultComponents}[2] (Command) is not equal to "Init" then the test is not passed
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo} => If ${ResultComponents}[3] (ErrorInformation) is not equal to "${ERROR_NoInfo} (00)" then the test is not passed
This command gets the status of a DI (Digital Input) as 1 or 0
This command may invoke FH_DI_GetStatus_DI01 to FH_DI_GetStatus_DI64
| Send Message Body | Description |
|---|---|
| DeviceAddress | It shall be equal to the address of the device (FH_RFCommunication_DeviceAddress) |
| Function | Function_DI (0x01) |
| Command | DI_Commands_GetStatus (0x01) |
| MessageDataLength | 1 byte (0x01) |
| MessageData | Digital Input Number (0x01 for DI01 to 0x40 for DI64) |
| Checksum | Sum of all the bytes (For user-friendly design purposes, not implemented => always 0xAA) |
| Result Message Body | Description |
|---|---|
| DeviceAddress (2 bytes) | Ascii equivalent of the hex address of the device (FH_RFCommunication_DeviceAddress) |
| Function (2 bytes) | "DI" |
| Command (9 bytes) | "GetStatus" |
| MessageData1 (2 bytes) | Ascii equivalent of the hex value of the Error Code (XX) in FH_ErrorInfo.h |
| MessageData2 (1 byte) | "0" or "1" (as status) |
==============================================================================
##### RobotFramework Example #####
==============================================================================
@{MessageData} = Create List ${DI01}
&{Message} = Create Dictionary DeviceAddress=${DeviceAddress_01} Function=${Function_DI} Command=${DI_Commands_GetStatus} Data=@{MessageData}
${Result} SendMessage &{Message}
Log Many Result = ${Result}
@{ResultComponents}= split string ${Result} |
Log Many DeviceAddress = ${ResultComponents}[0]
Log Many Function = ${ResultComponents}[1]
Log Many Command = ${ResultComponents}[2]
Log Many ErrorInformation = ${ResultComponents}[3]
Log Many Status = ${ResultComponents}[4]
Should Be Equal ${ResultComponents}[0] 01
Should Be Equal ${ResultComponents}[1] DI
Should Be Equal ${ResultComponents}[2] GetStatus
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo}
Should Be Equal ${ResultComponents}[4] 0
Comments:
DI01 => It indicates the Digital Input 01
DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
Function_DI => It is the function in the message frame
DI_Commands_GetStatus => It is the command of the function in the message frame
Result Example:
Log Many Result = ${Result} => 01|DI|GetStatus|00|0
@{ResultComponents}= split string ${Result} | => Split the result elements string by |
Log Many DeviceAddress = ${ResultComponents}[0] => DeviceAddress = 01
Log Many Function = ${ResultComponents}[1] => Function = DI
Log Many Command = ${ResultComponents}[2] => Command = GetStatus
Log Many ErrorInformation = ${ResultComponents}[3] => ErrorInformation = 00 (ERROR_NoInfo)
Should Be Equal ${ResultComponents}[0] 01 => If ${ResultComponents}[0] (DeviceAddress) is not equal to "01" then the test is not passed
Should Be Equal ${ResultComponents}[1] DI => If ${ResultComponents}[1] (Function) is not equal to "DI" then the test is not passed
Should Be Equal ${ResultComponents}[2] GetStatus => If ${ResultComponents}[2] (Command) is not equal to "GetStatus" then the test is not passed
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo} => If ${ResultComponents}[3] (ErrorInformation) is not equal to "${ERROR_NoInfo} (00)" then the test is not passed
Should Be Equal ${ResultComponents}[4] 0 => If ${ResultComponents}[4] (Status) is not equal to "0" then the test is not passed
This command initializes up to 64 DI (Digital Input)
This command may invoke FH_DI_Init_DI01 to FH_DI_Init_DI64
| Send Message Body | Description |
|---|---|
| DeviceAddress | It shall be equal to the address of the device (FH_RFCommunication_DeviceAddress) |
| Function | Function_DI (0x01) |
| Command | DI_Commands_InitMULTI (0x02) |
| MessageDataLength | 8 bytes (0x08) |
| MessageData1 | Digital Input Number Byte 1 for DI01 to DI08 (Example:0x82 => DI01 and DI07) |
| MessageData2 | Digital Input Number Byte 2 for DI09 to DI16 (Example:0x82 => DI09 and DI15) |
| MessageData3 | Digital Input Number Byte 3 for DI17 to DI24 (Example:0x82 => DI17 and DI23) |
| MessageData4 | Digital Input Number Byte 4 for DI25 to DI32 (Example:0x82 => DI25 and DI31) |
| MessageData5 | Digital Input Number Byte 5 for DI33 to DI40 (Example:0x82 => DI33 and DI39) |
| MessageData6 | Digital Input Number Byte 6 for DI41 to DI48 (Example:0x82 => DI41 and DI47) |
| MessageData7 | Digital Input Number Byte 7 for DI49 to DI56 (Example:0x82 => DI49 and DI55) |
| MessageData8 | Digital Input Number Byte 8 for DI57 to DI64 (Example:0x82 => DI57 and DI63) |
| Checksum | Sum of all the bytes (For user-friendly design purposes, not implemented => always 0xAA) |
| Result Message Body | Description |
|---|---|
| DeviceAddress (2 bytes) | Ascii equivalent of the hex address of the device (FH_RFCommunication_DeviceAddress) |
| Function (2 bytes) | "DI" |
| Command (9 bytes) | "InitMULTI" |
| MessageData (2 bytes) | Ascii equivalent of the hex value of the Error Code (XX) in FH_ErrorInfo.h |
==============================================================================
##### RobotFramework Example #####
==============================================================================
@{MessageData} = Create List FF FF FF FF FF FF FF FF
&{Message} = Create Dictionary DeviceAddress=${DeviceAddress_01} Function=${Function_DI} Command=${DI_Commands_InitMULTI} Data=@{MessageData}
${Result} SendMessage &{Message}
Log Many Result = ${Result}
@{ResultComponents}= split string ${Result} |
Log Many DeviceAddress = ${ResultComponents}[0]
Log Many Function = ${ResultComponents}[1]
Log Many Command = ${ResultComponents}[2]
Log Many ErrorInformation = ${ResultComponents}[3]
Should Be Equal ${ResultComponents}[0] 01
Should Be Equal ${ResultComponents}[1] DI
Should Be Equal ${ResultComponents}[2] InitMULTI
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo}
Comments:
FF FF FF FF FF FF FF FF => Example data as the first 8 parameters
DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
Function_DI => It is the function in the message frame
DI_Commands_InitMULTI => It is the command of the function in the message frame
Result Example:
Log Many Result = ${Result} => 01|DI|InitMULTI|00|
@{ResultComponents}= split string ${Result} | => Split the result elements string by |
Log Many DeviceAddress = ${ResultComponents}[0] => DeviceAddress = 01
Log Many Function = ${ResultComponents}[1] => Function = DI
Log Many Command = ${ResultComponents}[2] => Command = InitMULTI
Log Many ErrorInformation = ${ResultComponents}[3] => ErrorInformation = 00 (ERROR_NoInfo)
Should Be Equal ${ResultComponents}[0] 01 => If ${ResultComponents}[0] (DeviceAddress) is not equal to "01" then the test is not passed
Should Be Equal ${ResultComponents}[1] DI => If ${ResultComponents}[1] (Function) is not equal to "DI" then the test is not passed
Should Be Equal ${ResultComponents}[2] InitMULTI => If ${ResultComponents}[2] (Command) is not equal to "InitMULTI" then the test is not passed
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo} => If ${ResultComponents}[3] (ErrorInformation) is not equal to "${ERROR_NoInfo} (00)" then the test is not passed
This command gets the status of up to 64 DI (Digital Input)
This command may invoke FH_DI_GetStatus_DI01 to FH_DI_GetStatus_DI64
| Send Message Body | Description |
|---|---|
| DeviceAddress | It shall be equal to the address of the device (FH_RFCommunication_DeviceAddress) |
| Function | Function_DI (0x01) |
| Command | DI_Commands_GetStatusMULTI (0x03) |
| MessageDataLength | 8 bytes (0x08) |
| MessageData1 | Digital Input Number Byte 1 for DI01 to DI08 (Example:0x82 => Get Status of DI01 and DI07) |
| MessageData2 | Digital Input Number Byte 2 for DI09 to DI16 (Example:0x82 => Get Status of DI09 and DI15) |
| MessageData3 | Digital Input Number Byte 3 for DI17 to DI24 (Example:0x82 => Get Status of DI17 and DI23) |
| MessageData4 | Digital Input Number Byte 4 for DI25 to DI32 (Example:0x82 => Get Status of DI25 and DI31) |
| MessageData5 | Digital Input Number Byte 5 for DI33 to DI40 (Example:0x82 => Get Status of DI33 and DI39) |
| MessageData6 | Digital Input Number Byte 6 for DI41 to DI48 (Example:0x82 => Get Status of DI41 and DI47) |
| MessageData7 | Digital Input Number Byte 7 for DI49 to DI56 (Example:0x82 => Get Status of DI49 and DI55) |
| MessageData8 | Digital Input Number Byte 8 for DI57 to DI64 (Example:0x82 => Get Status of DI57 and DI63) |
| Checksum | Sum of all the bytes (For user-friendly design purposes, not implemented => always 0xAA) |
| Result Message Body | Description |
|---|---|
| DeviceAddress (2 bytes) | Ascii equivalent of the hex address of the device (FH_RFCommunication_DeviceAddress) |
| Function (2 bytes) | "DI" |
| Command (14 bytes) | "GetStatusMULTI" |
| MessageData1 (2 bytes) | Ascii equivalent of the hex value of the Error Code (XX) in FH_ErrorInfo.h |
| MessageData2 (2 bytes) | Ascii equivalent of the hex value of Digital Input Status Byte 1 for DI01 to DI08 (Example:"80" => DI01 is 1 and DI07 is 0) |
| MessageData3 (2 bytes) | Ascii equivalent of the hex value of Digital Input Status Byte 2 for DI09 to DI16 (Example:"80" => DI09 is 1 and DI15 is 0) |
| MessageData4 (2 bytes) | Ascii equivalent of the hex value of Digital Input Status Byte 3 for DI17 to DI24 (Example:"80" => DI17 is 1 and DI23 is 0) |
| MessageData5 (2 bytes) | Ascii equivalent of the hex value of Digital Input Status Byte 4 for DI25 to DI32 (Example:"80" => DI25 is 1 and DI31 is 0) |
| MessageData6 (2 bytes) | Ascii equivalent of the hex value of Digital Input Status Byte 5 for DI33 to DI40 (Example:"80" => DI33 is 1 and DI39 is 0) |
| MessageData7 (2 bytes) | Ascii equivalent of the hex value of Digital Input Status Byte 6 for DI41 to DI48 (Example:"80" => DI41 is 1 and DI47 is 0) |
| MessageData8 (2 bytes) | Ascii equivalent of the hex value of Digital Input Status Byte 7 for DI49 to DI56 (Example:"80" => DI49 is 1 and DI55 is 0) |
| MessageData9 (2 bytes) | Ascii equivalent of the hex value of Digital Input Status Byte 8 for DI57 to DI64 (Example:"80" => DI57 is 1 and DI63 is 0) |
==============================================================================
##### RobotFramework Example #####
==============================================================================
@{MessageData} = Create List FF FF FF FF FF FF FF FF
&{Message} = Create Dictionary DeviceAddress=${DeviceAddress_01} Function=${Function_DI} Command=${DI_Commands_GetStatusMULTI} Data=@{MessageData}
${Result} SendMessage &{Message}
Log Many Result = ${Result}
@{ResultComponents}= split string ${Result} |
Log Many DeviceAddress = ${ResultComponents}[0]
Log Many Function = ${ResultComponents}[1]
Log Many Command = ${ResultComponents}[2]
Log Many ErrorInformation = ${ResultComponents}[3]
Log Many Status = ${ResultComponents}[4]
Should Be Equal ${ResultComponents}[0] 01
Should Be Equal ${ResultComponents}[1] DI
Should Be Equal ${ResultComponents}[2] GetStatusMULTI
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo}
Should Be Equal ${ResultComponents}[4] 0011001100220022
Comments:
FF FF FF FF FF FF FF FF => Example data as the first 8 parameters
DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
Function_DI => It is the function in the message frame
DI_Commands_GetStatusMULTI => It is the command of the function in the message frame
Result Example:
Log Many Result = ${Result} => 01|DI|GetStatusMULTI|00|0011001100220022
@{ResultComponents}= split string ${Result} | => Split the result elements string by |
Log Many DeviceAddress = ${ResultComponents}[0] => DeviceAddress = 01
Log Many Function = ${ResultComponents}[1] => Function = DI
Log Many Command = ${ResultComponents}[2] => Command = GetStatusMULTI
Log Many ErrorInformation = ${ResultComponents}[3] => ErrorInformation = 00 (ERROR_NoInfo)
Should Be Equal ${ResultComponents}[0] 01 => If ${ResultComponents}[0] (DeviceAddress) is not equal to "01" then the test is not passed
Should Be Equal ${ResultComponents}[1] DI => If ${ResultComponents}[1] (Function) is not equal to "DI" then the test is not passed
Should Be Equal ${ResultComponents}[2] GetStatusMULTI => If ${ResultComponents}[2] (Command) is not equal to "GetStatusMULTI" then the test is not passed
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo} => If ${ResultComponents}[3] (ErrorInformation) is not equal to "${ERROR_NoInfo} (00)" then the test is not passed
Should Be Equal ${ResultComponents}[4] 0011001100220022 => If ${ResultComponents}[4] (Status) is not equal to "0011001100220022" then the test is not passed
Message | Description |
|---|---|
| AO_Commands_Init | Initializes a AO (Analog Output) |
| AO_Commands_SetStatus | Sets the status of a AO (Analog Output) |
This command initializes a AO (Analog Output)
This command may invoke FH_AO_Init_AO01 to FH_AO_Init_AO64
| Send Message Body | Description |
|---|---|
| DeviceAddress | It shall be equal to the address of the device (FH_RFCommunication_DeviceAddress) |
| Function | Function_AO (0x02) |
| Command | AO_Commands_Init (0x00) |
| MessageDataLength | 1 byte (0x01) |
| MessageData | Analog Output Number (0x01 for AO01 to 0x40 for AO64) |
| Checksum | Sum of all the bytes (For user-friendly design purposes, not implemented => always 0xAA) |
| Result Message Body | Description |
|---|---|
| DeviceAddress (2 bytes) | Ascii equivalent of the hex address of the device (FH_RFCommunication_DeviceAddress) |
| Function (2 bytes) | "AO" |
| Command (4 bytes) | "Init" |
| MessageData (2 bytes) | Ascii equivalent of the hex value of the Error Code (XX) in FH_ErrorInfo.h |
==============================================================================
##### RobotFramework Example #####
==============================================================================
@{MessageData} = Create List ${AO01}
&{Message} = Create Dictionary DeviceAddress=${DeviceAddress_01} Function=${Function_AO} Command=${AO_Commands_Init} Data=@{MessageData}
${Result} SendMessage &{Message}
Log Many Result = ${Result}
@{ResultComponents}= split string ${Result} |
Log Many DeviceAddress = ${ResultComponents}[0]
Log Many Function = ${ResultComponents}[1]
Log Many Command = ${ResultComponents}[2]
Log Many ErrorInformation = ${ResultComponents}[3]
Should Be Equal ${ResultComponents}[0] 01
Should Be Equal ${ResultComponents}[1] AO
Should Be Equal ${ResultComponents}[2] Init
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo}
Comments:
AO01 => It indicates the Analog Output 01
DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
Function_AO => It is the function in the message frame
AO_Commands_Init => It is the command of the function in the message frame
Result Example:
Log Many Result = ${Result} => 01|AO|Init|00|
@{ResultComponents}= split string ${Result} | => Split the result elements string by |
Log Many DeviceAddress = ${ResultComponents}[0] => DeviceAddress = 01
Log Many Function = ${ResultComponents}[1] => Function = AO
Log Many Command = ${ResultComponents}[2] => Command = Init
Log Many ErrorInformation = ${ResultComponents}[3] => ErrorInformation = 00 (ERROR_NoInfo)
Should Be Equal ${ResultComponents}[0] 01 => If ${ResultComponents}[0] (DeviceAddress) is not equal to "01" then the test is not passed
Should Be Equal ${ResultComponents}[1] AO => If ${ResultComponents}[1] (Function) is not equal to "AO" then the test is not passed
Should Be Equal ${ResultComponents}[2] Init => If ${ResultComponents}[2] (Command) is not equal to "Init" then the test is not passed
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo} => If ${ResultComponents}[3] (ErrorInformation) is not equal to "${ERROR_NoInfo} (00)" then the test is not passed
This command sets the status of a AO (Analog Output))
This command may invoke FH_AO_SetStatus_AO01 to FH_AO_SetStatus_AO64
| Send Message Body | Description |
|---|---|
| DeviceAddress | It shall be equal to the address of the device (FH_RFCommunication_DeviceAddress) |
| Function | Function_AO (0x02) |
| Command | AO_Commands_SetStatus (0x01) |
| MessageDataLength | 5 bytes (0x05) |
| MessageData1 | Analog Output Number (0x01 for Analog Output Number 01 to 0x40 for Analog Output Number 64) |
| MessageData2 | Analog value Byte 4 |
| MessageData3 | Analog value Byte 3 |
| MessageData4 | Analog value Byte 2 |
| MessageData5 | Analog value Byte 1 |
| Checksum | Sum of all the bytes (For user-friendly design purposes, not implemented => always 0xAA) |
| Result Message Body | Description |
|---|---|
| DeviceAddress (2 bytes) | Ascii equivalent of the hex address of the device (FH_RFCommunication_DeviceAddress) |
| Function (2 bytes) | "AO" |
| Command (9 bytes) | "SetStatus" |
| MessageData (2 bytes) | Ascii equivalent of the hex value of the Error Code (XX) in FH_ErrorInfo.h |
==============================================================================
##### RobotFramework Example #####
==============================================================================
@{MessageData} = Create List ${AO01} F1 C2 01 08
&{Message} = Create Dictionary DeviceAddress=${DeviceAddress_01} Function=${Function_AO} Command=${AO_Commands_SetStatus} Data=@{MessageData}
${Result} SendMessage &{Message}
Log Many Result = ${Result}
@{ResultComponents}= split string ${Result} |
Log Many DeviceAddress = ${ResultComponents}[0]
Log Many Function = ${ResultComponents}[1]
Log Many Command = ${ResultComponents}[2]
Log Many ErrorInformation = ${ResultComponents}[3]
Should Be Equal ${ResultComponents}[0] 01
Should Be Equal ${ResultComponents}[1] AO
Should Be Equal ${ResultComponents}[2] SetStatus
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo}
Comments:
AO01 => It indicates the Analog Output 01
F1 C2 01 08 => Example data as analog value (0xF1C20108) to be set through the <b>Analog Output 01</b>\n
DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
Function_AO => It is the function in the message frame
AO_Commands_SetStatus => It is the command of the function in the message frame
Result Example:
Log Many Result = ${Result} => 01|AO|SetStatus|00|
@{ResultComponents}= split string ${Result} | => Split the result elements string by |
Log Many DeviceAddress = ${ResultComponents}[0] => DeviceAddress = 01
Log Many Function = ${ResultComponents}[1] => Function = AO
Log Many Command = ${ResultComponents}[2] => Command = SetStatus
Log Many ErrorInformation = ${ResultComponents}[3] => ErrorInformation = 00 (ERROR_NoInfo)
Should Be Equal ${ResultComponents}[0] 01 => If ${ResultComponents}[0] (DeviceAddress) is not equal to "01" then the test is not passed
Should Be Equal ${ResultComponents}[1] AO => If ${ResultComponents}[1] (Function) is not equal to "AO" then the test is not passed
Should Be Equal ${ResultComponents}[2] SetStatus => If ${ResultComponents}[2] (Command) is not equal to "SetStatus" then the test is not passed
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo} => If ${ResultComponents}[3] (ErrorInformation) is not equal to "${ERROR_NoInfo} (00)" then the test is not passed
Message | Description |
|---|---|
| AI_Commands_Init | Initializes a AI (Analog Input) |
| AI_Commands_GetStatus | Gets the status of a AI (Analog Input) as 1 or 0 |
This command initializes a AI (Analog Input)
This command may invoke FH_AI_Init_AI01 to FH_AI_Init_AI64
| Send Message Body | Description |
|---|---|
| DeviceAddress | It shall be equal to the address of the device (FH_RFCommunication_DeviceAddress) |
| Function | Function_AI (0x03) |
| Command | AI_Commands_Init (0x00) |
| MessageDataLength | 1 byte (0x01) |
| MessageData | Analog Input Number (0x01 for AI01 to 0x40 for AI64) |
| Checksum | Sum of all the bytes (For user-friendly design purposes, not implemented => always 0xAA) |
| Result Message Body | Description |
|---|---|
| DeviceAddress (2 bytes) | Ascii equivalent of the hex address of the device (FH_RFCommunication_DeviceAddress) |
| Function (2 bytes) | "AI" |
| Command (4 bytes) | "Init" |
| MessageData (2 bytes) | Ascii equivalent of the hex value of the Error Code (XX) in FH_ErrorInfo.h |
==============================================================================
##### RobotFramework Example #####
==============================================================================
@{MessageData} = Create List ${AI01}
&{Message} = Create Dictionary DeviceAddress=${DeviceAddress_01} Function=${Function_AI} Command=${AI_Commands_Init} Data=@{MessageData}
${Result} SendMessage &{Message}
Log Many Result = ${Result}
@{ResultComponents}= split string ${Result} |
Log Many DeviceAddress = ${ResultComponents}[0]
Log Many Function = ${ResultComponents}[1]
Log Many Command = ${ResultComponents}[2]
Log Many ErrorInformation = ${ResultComponents}[3]
Should Be Equal ${ResultComponents}[0] 01
Should Be Equal ${ResultComponents}[1] AI
Should Be Equal ${ResultComponents}[2] Init
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo}
Comments:
AI01 => It indicates the Analog Input 01
DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
Function_AI => It is the function in the message frame
AI_Commands_Init => It is the command of the function in the message frame
Result Example:
Log Many Result = ${Result} => 01|AI|Init|00|
@{ResultComponents}= split string ${Result} | => Split the result elements string by |
Log Many DeviceAddress = ${ResultComponents}[0] => DeviceAddress = 01
Log Many Function = ${ResultComponents}[1] => Function = AI
Log Many Command = ${ResultComponents}[2] => Command = Init
Log Many ErrorInformation = ${ResultComponents}[3] => ErrorInformation = 00 (ERROR_NoInfo)
Should Be Equal ${ResultComponents}[0] 01 => If ${ResultComponents}[0] (DeviceAddress) is not equal to "01" then the test is not passed
Should Be Equal ${ResultComponents}[1] AI => If ${ResultComponents}[1] (Function) is not equal to "AI" then the test is not passed
Should Be Equal ${ResultComponents}[2] Init => If ${ResultComponents}[2] (Command) is not equal to "Init" then the test is not passed
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo} => If ${ResultComponents}[3] (ErrorInformation) is not equal to "${ERROR_NoInfo} (00)" then the test is not passed
This command gets the status of a AI (Analog Input) as 1 or 0
This command may invoke FH_AI_GetStatus_AI01 to FH_AI_GetStatus_AI64
| Send Message Body | Description |
|---|---|
| DeviceAddress | It shall be equal to the address of the device (FH_RFCommunication_DeviceAddress) |
| Function | Function_AI (0x03) |
| Command | AI_Commands_GetStatus (0x01) |
| MessageDataLength | 1 byte (0x01) |
| MessageData | Analog Input Number (0x01 for AI01 to 0x40 for AI64) |
| Checksum | Sum of all the bytes (For user-friendly design purposes, not implemented => always 0xAA) |
| Result Message Body | Description |
|---|---|
| DeviceAddress (2 bytes) | Ascii equivalent of the hex address of the device (FH_RFCommunication_DeviceAddress) |
| Function (2 bytes) | "AI" |
| Command (9 bytes) | "GetStatus" |
| MessageData1 (2 bytes) | Ascii equivalent of the hex value of the Error Code (XX) in FH_ErrorInfo.h |
| MessageData2 (2 bytes) | Ascii equivalent of the hex value of the analog value byte 4 |
| MessageData3 (2 bytes) | Ascii equivalent of the hex value of the analog value byte 3 |
| MessageData4 (2 bytes) | Ascii equivalent of the hex value of the analog value byte 2 |
| MessageData5 (2 bytes) | Ascii equivalent of the hex value of the analog value byte 1 |
==============================================================================
##### RobotFramework Example #####
==============================================================================
@{MessageData} = Create List ${AI01}
&{Message} = Create Dictionary DeviceAddress=${DeviceAddress_01} Function=${Function_AI} Command=${AI_Commands_GetStatus} Data=@{MessageData}
${Result} SendMessage &{Message}
Log Many Result = ${Result}
@{ResultComponents}= split string ${Result} |
Log Many DeviceAddress = ${ResultComponents}[0]
Log Many Function = ${ResultComponents}[1]
Log Many Command = ${ResultComponents}[2]
Log Many ErrorInformation = ${ResultComponents}[3]
Log Many Status = ${ResultComponents}[4]
Should Be Equal ${ResultComponents}[0] 01
Should Be Equal ${ResultComponents}[1] AI
Should Be Equal ${ResultComponents}[2] GetStatus
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo}
Should Be Equal ${ResultComponents}[4] 00110011
Comments:
AI01 => It indicates the Analog Input 01
DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
Function_AI => It is the function in the message frame
AI_Commands_GetStatus => It is the command of the function in the message frame
Result Example:
Log Many Result = ${Result} => 01|AI|GetStatus|00|00110011
@{ResultComponents}= split string ${Result} | => Split the result elements string by |
Log Many DeviceAddress = ${ResultComponents}[0] => DeviceAddress = 01
Log Many Function = ${ResultComponents}[1] => Function = AI
Log Many Command = ${ResultComponents}[2] => Command = GetStatus
Log Many ErrorInformation = ${ResultComponents}[3] => ErrorInformation = 00 (ERROR_NoInfo)
Should Be Equal ${ResultComponents}[0] 01 => If ${ResultComponents}[0] (DeviceAddress) is not equal to "01" then the test is not passed
Should Be Equal ${ResultComponents}[1] AI => If ${ResultComponents}[1] (Function) is not equal to "AI" then the test is not passed
Should Be Equal ${ResultComponents}[2] GetStatus => If ${ResultComponents}[2] (Command) is not equal to "GetStatus" then the test is not passed
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo} => If ${ResultComponents}[3] (ErrorInformation) is not equal to "${ERROR_NoInfo} (00)" then the test is not passed
Should Be Equal ${ResultComponents}[4] 00110011 => If ${ResultComponents}[4] (Status) is not equal to "00110011" then the test is not passed
Message | Description |
|---|---|
| PWMO_Commands_Init | Initializes a PWMO (PWM Output) |
| PWMO_Commands_SetStatus | Sets the status of a PWMO (PWM Output) |
This command initializes a PWMO (PWM Output)
This command may invoke FH_PWMO_Init_PWMO01 to FH_PWMO_Init_PWMO64
| Send Message Body | Description |
|---|---|
| DeviceAddress | It shall be equal to the address of the device (FH_RFCommunication_DeviceAddress) |
| Function | Function_PWMO (0x04) |
| Command | PWMO_Commands_Init (0x00) |
| MessageDataLength | 1 byte (0x01) |
| MessageData | PWM Output Number (0x01 for PWMO01 to 0x40 for PWMO64) |
| Checksum | Sum of all the bytes (For user-friendly design purposes, not implemented => always 0xAA) |
| Result Message Body | Description |
|---|---|
| DeviceAddress (2 bytes) | Ascii equivalent of the hex address of the device (FH_RFCommunication_DeviceAddress) |
| Function (4 bytes) | "PWMO" |
| Command (4 bytes) | "Init" |
| MessageData (2 bytes) | Ascii equivalent of the hex value of the Error Code (XX) in FH_ErrorInfo.h |
==============================================================================
##### RobotFramework Example #####
==============================================================================
@{MessageData} = Create List ${PWMO01}
&{Message} = Create Dictionary DeviceAddress=${DeviceAddress_01} Function=${Function_PWMO} Command=${PWMO_Commands_Init} Data=@{MessageData}
${Result} SendMessage &{Message}
Log Many Result = ${Result}
@{ResultComponents}= split string ${Result} |
Log Many DeviceAddress = ${ResultComponents}[0]
Log Many Function = ${ResultComponents}[1]
Log Many Command = ${ResultComponents}[2]
Log Many ErrorInformation = ${ResultComponents}[3]
Should Be Equal ${ResultComponents}[0] 01
Should Be Equal ${ResultComponents}[1] PWMO
Should Be Equal ${ResultComponents}[2] Init
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo}
Comments:
PWMO01 => It indicates the PWM Output 01
DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
Function_PWMO => It is the function in the message frame
PWMO_Commands_Init => It is the command of the function in the message frame
Result Example:
Log Many Result = ${Result} => 01|PWMO|Init|00|
@{ResultComponents}= split string ${Result} | => Split the result elements string by |
Log Many DeviceAddress = ${ResultComponents}[0] => DeviceAddress = 01
Log Many Function = ${ResultComponents}[1] => Function = PWMO
Log Many Command = ${ResultComponents}[2] => Command = Init
Log Many ErrorInformation = ${ResultComponents}[3] => ErrorInformation = 00 (ERROR_NoInfo)
Should Be Equal ${ResultComponents}[0] 01 => If ${ResultComponents}[0] (DeviceAddress) is not equal to "01" then the test is not passed
Should Be Equal ${ResultComponents}[1] PWMO => If ${ResultComponents}[1] (Function) is not equal to "PWMO" then the test is not passed
Should Be Equal ${ResultComponents}[2] Init => If ${ResultComponents}[2] (Command) is not equal to "Init" then the test is not passed
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo} => If ${ResultComponents}[3] (ErrorInformation) is not equal to "${ERROR_NoInfo} (00)" then the test is not passed
This command sets the status of a PWMO (PWM Output))
This command may invoke FH_PWMO_SetStatus_PWMO01 to FH_PWMO_SetStatus_PWMO64
| Send Message Body | Description |
|---|---|
| DeviceAddress | It shall be equal to the address of the device (FH_RFCommunication_DeviceAddress) |
| Function | Function_PWMO (0x04) |
| Command | PWMO_Commands_SetStatus (0x01) |
| MessageDataLength | 6 bytes (0x06) |
| MessageData1 | PWM Output Number (0x01 for PWM Output Number 01 to 0x40 for PWM Output Number 64) |
| MessageData2 | PWM frequency value Byte 4 |
| MessageData3 | PWM frequency value Byte 3 |
| MessageData4 | PWM frequency value Byte 2 |
| MessageData5 | PWM frequency value Byte 1 |
| MessageData6 | PWM duty cycle value |
| Checksum | Sum of all the bytes (For user-friendly design purposes, not implemented => always 0xAA) |
| Result Message Body | Description |
|---|---|
| DeviceAddress (2 bytes) | Ascii equivalent of the hex address of the device (FH_RFCommunication_DeviceAddress) |
| Function (4 bytes) | "PWMO" |
| Command (9 bytes) | "SetStatus" |
| MessageData (2 bytes) | Ascii equivalent of the hex value of the Error Code (XX) in FH_ErrorInfo.h |
==============================================================================
##### RobotFramework Example #####
==============================================================================
@{MessageData} = Create List ${PWMO01} 00 00 00 F0 32
&{Message} = Create Dictionary DeviceAddress=${DeviceAddress_01} Function=${Function_PWMO} Command=${PWMO_Commands_SetStatus} Data=@{MessageData}
${Result} SendMessage &{Message}
Log Many Result = ${Result}
@{ResultComponents}= split string ${Result} |
Log Many DeviceAddress = ${ResultComponents}[0]
Log Many Function = ${ResultComponents}[1]
Log Many Command = ${ResultComponents}[2]
Log Many ErrorInformation = ${ResultComponents}[3]
Should Be Equal ${ResultComponents}[0] 01
Should Be Equal ${ResultComponents}[1] PWMO
Should Be Equal ${ResultComponents}[2] SetStatus
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo}
Comments:
PWMO01 => It indicates the PWM Output 01
00 00 00 F0 => Example data as PWM frequency (0x000000F0) to be set through the <b>PWM Output 01</b>\n
32 => Example data as PWM duty cycle (0x32 => as 50% duty cycle) to be set through the <b>PWM Output 01</b>\n
DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
Function_PWMO => It is the function in the message frame
PWMO_Commands_SetStatus => It is the command of the function in the message frame
Result Example:
Log Many Result = ${Result} => 01|PWMO|SetStatus|00|
@{ResultComponents}= split string ${Result} | => Split the result elements string by |
Log Many DeviceAddress = ${ResultComponents}[0] => DeviceAddress = 01
Log Many Function = ${ResultComponents}[1] => Function = PWMO
Log Many Command = ${ResultComponents}[2] => Command = SetStatus
Log Many ErrorInformation = ${ResultComponents}[3] => ErrorInformation = 00 (ERROR_NoInfo)
Should Be Equal ${ResultComponents}[0] 01 => If ${ResultComponents}[0] (DeviceAddress) is not equal to "01" then the test is not passed
Should Be Equal ${ResultComponents}[1] PWMO => If ${ResultComponents}[1] (Function) is not equal to "PWMO" then the test is not passed
Should Be Equal ${ResultComponents}[2] SetStatus => If ${ResultComponents}[2] (Command) is not equal to "SetStatus" then the test is not passed
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo} => If ${ResultComponents}[3] (ErrorInformation) is not equal to "${ERROR_NoInfo} (00)" then the test is not passed
Message | Description |
|---|---|
| PWMI_Commands_Init | Initializes a PWMI (PWM Input) |
| PWMI_Commands_GetStatus | Gets the status of a PWMI (PWM Input) as 1 or 0 |
This command initializes a PWMI (PWM Input)
This command may invoke FH_PWMI_Init_PWMI01 to FH_PWMI_Init_PWMI64
| Send Message Body | Description |
|---|---|
| DeviceAddress | It shall be equal to the address of the device (FH_RFCommunication_DeviceAddress) |
| Function | Function_PWMI (0x05) |
| Command | PWMI_Commands_Init (0x00) |
| MessageDataLength | 1 byte (0x01) |
| MessageData | PWM Input Number (0x01 for PWMI01 to 0x40 for PWMI64) |
| Checksum | Sum of all the bytes (For user-friendly design purposes, not implemented => always 0xAA) |
| Result Message Body | Description |
|---|---|
| DeviceAddress (2 bytes) | Ascii equivalent of the hex address of the device (FH_RFCommunication_DeviceAddress) |
| Function (4 bytes) | "PWMI" |
| Command (4 bytes) | "Init" |
| MessageData (2 bytes) | Ascii equivalent of the hex value of the Error Code (XX) in FH_ErrorInfo.h |
==============================================================================
##### RobotFramework Example #####
==============================================================================
@{MessageData} = Create List ${PWMI01}
&{Message} = Create Dictionary DeviceAddress=${DeviceAddress_01} Function=${Function_PWMI} Command=${PWMI_Commands_Init} Data=@{MessageData}
${Result} SendMessage &{Message}
Log Many Result = ${Result}
@{ResultComponents}= split string ${Result} |
Log Many DeviceAddress = ${ResultComponents}[0]
Log Many Function = ${ResultComponents}[1]
Log Many Command = ${ResultComponents}[2]
Log Many ErrorInformation = ${ResultComponents}[3]
Should Be Equal ${ResultComponents}[0] 01
Should Be Equal ${ResultComponents}[1] PWMI
Should Be Equal ${ResultComponents}[2] Init
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo}
Comments:
PWMI01 => It indicates the PWM Input 01
DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
Function_PWMI => It is the function in the message frame
PWMI_Commands_Init => It is the command of the function in the message frame
Result Example:
Log Many Result = ${Result} => 01|PWMI|Init|00|
@{ResultComponents}= split string ${Result} | => Split the result elements string by |
Log Many DeviceAddress = ${ResultComponents}[0] => DeviceAddress = 01
Log Many Function = ${ResultComponents}[1] => Function = PWMI
Log Many Command = ${ResultComponents}[2] => Command = Init
Log Many ErrorInformation = ${ResultComponents}[3] => ErrorInformation = 00 (ERROR_NoInfo)
Should Be Equal ${ResultComponents}[0] 01 => If ${ResultComponents}[0] (DeviceAddress) is not equal to "01" then the test is not passed
Should Be Equal ${ResultComponents}[1] PWMI => If ${ResultComponents}[1] (Function) is not equal to "PWMI" then the test is not passed
Should Be Equal ${ResultComponents}[2] Init => If ${ResultComponents}[2] (Command) is not equal to "Init" then the test is not passed
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo} => If ${ResultComponents}[3] (ErrorInformation) is not equal to "${ERROR_NoInfo} (00)" then the test is not passed
This command gets the status of a PWMI (PWM Input) as 1 or 0
This command may invoke FH_PWMI_GetStatus_PWMI01 to FH_PWMI_GetStatus_PWMI64
| Send Message Body | Description |
|---|---|
| DeviceAddress | It shall be equal to the address of the device (FH_RFCommunication_DeviceAddress) |
| Function | Function_PWMI (0x05) |
| Command | PWMI_Commands_GetStatus (0x01) |
| MessageDataLength | 1 byte (0x01) |
| MessageData | PWM Input Number (0x01 for PWMI01 to 0x40 for PWMI64) |
| Checksum | Sum of all the bytes (For user-friendly design purposes, not implemented => always 0xAA) |
| Result Message Body | Description |
|---|---|
| DeviceAddress (2 bytes) | Ascii equivalent of the hex address of the device (FH_RFCommunication_DeviceAddress) |
| Function (4 bytes) | "PWMI" |
| Command (9 bytes) | "GetStatus" |
| MessageData1 (2 bytes) | Ascii equivalent of the hex value of the Error Code (XX) in FH_ErrorInfo.h |
| MessageData2 (2 bytes) | Ascii equivalent of the hex value of the PWM frequency value byte 4 |
| MessageData3 (2 bytes) | Ascii equivalent of the hex value of the PWM frequency value byte 3 |
| MessageData4 (2 bytes) | Ascii equivalent of the hex value of the PWM frequency value byte 2 |
| MessageData5 (2 bytes) | Ascii equivalent of the hex value of the PWM frequency value byte 1 |
| MessageData6 (2 bytes) | Ascii equivalent of the hex value of the PWM duty cycle |
==============================================================================
##### RobotFramework Example #####
==============================================================================
@{MessageData} = Create List ${PWMI01}
&{Message} = Create Dictionary DeviceAddress=${DeviceAddress_01} Function=${Function_PWMI} Command=${PWMI_Commands_GetStatus} Data=@{MessageData}
${Result} SendMessage &{Message}
Log Many Result = ${Result}
@{ResultComponents}= split string ${Result} |
Log Many DeviceAddress = ${ResultComponents}[0]
Log Many Function = ${ResultComponents}[1]
Log Many Command = ${ResultComponents}[2]
Log Many ErrorInformation = ${ResultComponents}[3]
Log Many Frequency = ${ResultComponents}[4]
Log Many Duty Cycle = ${ResultComponents}[5]
Should Be Equal ${ResultComponents}[0] 01
Should Be Equal ${ResultComponents}[1] PWMI
Should Be Equal ${ResultComponents}[2] GetStatus
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo}
Should Be Equal ${ResultComponents}[4] 00110011
Should Be Equal ${ResultComponents}[5] 32
Comments:
PWMI01 => It indicates the PWM Input 01
DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
Function_PWMI => It is the function in the message frame
PWMI_Commands_GetStatus => It is the command of the function in the message frame
Result Example:
Log Many Result = ${Result} => 01|PWMI|GetStatus|00|00110011|32
@{ResultComponents}= split string ${Result} | => Split the result elements string by |
Log Many DeviceAddress = ${ResultComponents}[0] => DeviceAddress = 01
Log Many Function = ${ResultComponents}[1] => Function = PWMI
Log Many Command = ${ResultComponents}[2] => Command = GetStatus
Log Many ErrorInformation = ${ResultComponents}[3] => ErrorInformation = 00 (ERROR_NoInfo)
Should Be Equal ${ResultComponents}[0] 01 => If ${ResultComponents}[0] (DeviceAddress) is not equal to "01" then the test is not passed
Should Be Equal ${ResultComponents}[1] PWMI => If ${ResultComponents}[1] (Function) is not equal to "PWMI" then the test is not passed
Should Be Equal ${ResultComponents}[2] GetStatus => If ${ResultComponents}[2] (Command) is not equal to "GetStatus" then the test is not passed
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo} => If ${ResultComponents}[3] (ErrorInformation) is not equal to "${ERROR_NoInfo} (00)" then the test is not passed
Should Be Equal ${ResultComponents}[4] 00110011 => If ${ResultComponents}[4] (Frequency) is not equal to "00110011" then the test is not passed
Should Be Equal ${ResultComponents}[5] 32 => If ${ResultComponents}[5] (Duty cycle) is not equal to "32" then the test is not passed
Message | Description |
|---|---|
| UART_Commands_Init | Initializes a UART |
| UART_Commands_Send | Sends data through the UART |
| UART_Commands_Receive | Retrieves the ISR (Interrupt Service Routine) receive buffer of the UART |
| UART_Commands_ReceiveW | Waits to receive the specified number of bytes of data through the ISR (Interrupt Service Routine) receive buffer of the UART |
| UART_Commands_ResetRB | Resets the ISR (Interrupt Service Routine) receive buffer index of the UART |
| UART_Commands_SSD8 | Sets the shared data buffer (8 bit buffer) of the UART |
| UART_Commands_SSD16 | Sets the shared data buffer (16 bit buffer) of the UART |
| UART_Commands_SSD32 | Sets the shared data buffer (32 bit buffer) of the UART |
| UART_Commands_GSSD8 | Gets the shared data buffer (8 bit buffer) of the UART |
| UART_Commands_GSD16 | Gets the shared data buffer (16 bit buffer) of the UART |
| UART_Commands_GSD32 | Gets the shared data buffer (32 bit buffer) of the UART |
This command initializes a UART
This command may invoke FH_UART_Init_UART01 to FH_UART_Init_UART08
| Send Message Body | Description |
|---|---|
| DeviceAddress | It shall be equal to the address of the device (FH_RFCommunication_DeviceAddress) |
| Function | Function_UART (0x06) |
| Command | UART_Commands_Init (0x00) |
| MessageDataLength | 1 byte (0x01) |
| MessageData | UART Number (0x01 for UART01 to 0x08 for UART08) |
| Checksum | Sum of all the bytes (For user-friendly design purposes, not implemented => always 0xAA) |
| Result Message Body | Description |
|---|---|
| DeviceAddress (2 bytes) | Ascii equivalent of the hex address of the device (FH_RFCommunication_DeviceAddress) |
| Function (2 bytes) | "UART" |
| Command (4 bytes) | "Init" |
| MessageData (2 bytes) | Ascii equivalent of the hex value of the Error Code (XX) in FH_ErrorInfo.h |
==============================================================================
##### RobotFramework Example #####
==============================================================================
@{MessageData} = Create List ${UART01}
&{Message} = Create Dictionary DeviceAddress=${DeviceAddress_01} Function=${Function_UART} Command=${UART_Commands_Init} Data=@{MessageData}
${Result} SendMessage &{Message}
Log Many Result = ${Result}
@{ResultComponents}= split string ${Result} |
Log Many DeviceAddress = ${ResultComponents}[0]
Log Many Function = ${ResultComponents}[1]
Log Many Command = ${ResultComponents}[2]
Log Many ErrorInformation = ${ResultComponents}[3]
Should Be Equal ${ResultComponents}[0] 01
Should Be Equal ${ResultComponents}[1] UART
Should Be Equal ${ResultComponents}[2] Init
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo}
Comments:
UART01 => It indicates the UART 01
DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
Function_UART => It is the function in the message frame
UART_Commands_Init => It is the command of the function in the message frame
Result Example:
Log Many Result = ${Result} => 01|UART|Init|00|
@{ResultComponents}= split string ${Result} | => Split the result elements string by |
Log Many DeviceAddress = ${ResultComponents}[0] => DeviceAddress = 01
Log Many Function = ${ResultComponents}[1] => Function = UART
Log Many Command = ${ResultComponents}[2] => Command = Init
Log Many ErrorInformation = ${ResultComponents}[3] => ErrorInformation = 00 (ERROR_NoInfo)
Should Be Equal ${ResultComponents}[0] 01 => If ${ResultComponents}[0] (DeviceAddress) is not equal to "01" then the test is not passed
Should Be Equal ${ResultComponents}[1] UART => If ${ResultComponents}[1] (Function) is not equal to "UART" then the test is not passed
Should Be Equal ${ResultComponents}[2] Init => If ${ResultComponents}[2] (Command) is not equal to "Init" then the test is not passed
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo} => If ${ResultComponents}[3] (ErrorInformation) is not equal to "${ERROR_NoInfo} (00)" then the test is not passed
This command sends data through the UART
This command may invoke FH_UART_Send_UART01 to FH_UART_Send_UART08
| Send Message Body | Description |
|---|---|
| DeviceAddress | It shall be equal to the address of the device (FH_RFCommunication_DeviceAddress) |
| Function | Function_UART (0x06) |
| Command | UART_Commands_Send (0x01) |
| MessageDataLength | N bytes (Example: N = 5 => 0x05) |
| MessageData1 | UART Number (0x01 for UART01 to 0x08 for UART08) |
| MessageData2 | Length of the data to be sent |
| MessageData3 | Data byte1 to be sent |
| MessageData... | Data byte... to be sent |
| MessageDataN | Data byteN to be sent |
| Checksum | Sum of all the bytes (For user-friendly design purposes, not implemented => always 0xAA) |
| Result Message Body | Description |
|---|---|
| DeviceAddress (2 bytes) | Ascii equivalent of the hex address of the device (FH_RFCommunication_DeviceAddress) |
| Function (4 bytes) | "UART" |
| Command (4 bytes) | "Send" |
| MessageData (2 bytes) | Ascii equivalent of the hex value of the Error Code (XX) in FH_ErrorInfo.h |
==============================================================================
##### RobotFramework Example #####
==============================================================================
@{MessageData} = Create List ${UART01} 02 B1 FF
&{Message} = Create Dictionary DeviceAddress=${DeviceAddress_01} Function=${Function_UART} Command=${UART_Commands_Send} Data=@{MessageData}
${Result} SendMessage &{Message}
Log Many Result = ${Result}
@{ResultComponents}= split string ${Result} |
Log Many DeviceAddress = ${ResultComponents}[0]
Log Many Function = ${ResultComponents}[1]
Log Many Command = ${ResultComponents}[2]
Log Many ErrorInformation = ${ResultComponents}[3]
Should Be Equal ${ResultComponents}[0] 01
Should Be Equal ${ResultComponents}[1] UART
Should Be Equal ${ResultComponents}[2] Send
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo}
Comments:
UART01 => It indicates the UART 01
02 => Example length of the data to be sent
B1 FF => Example data (0xB1, 0xFF) to be sent (or apart from the data to be sent, it may include some other data like ID, Filter, ... to be processed too, if need be) through the <b>UART 01</b>\n
DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
Function_UART => It is the function in the message frame
UART_Commands_Send => It is the command of the function in the message frame
Result Example:
Log Many Result = ${Result} => 01|UART|Send|00|
@{ResultComponents}= split string ${Result} | => Split the result elements string by |
Log Many DeviceAddress = ${ResultComponents}[0] => DeviceAddress = 01
Log Many Function = ${ResultComponents}[1] => Function = UART
Log Many Command = ${ResultComponents}[2] => Command = Send
Log Many ErrorInformation = ${ResultComponents}[3] => ErrorInformation = 00 (ERROR_NoInfo)
Should Be Equal ${ResultComponents}[0] 01 => If ${ResultComponents}[0] (DeviceAddress) is not equal to "01" then the test is not passed
Should Be Equal ${ResultComponents}[1] UART => If ${ResultComponents}[1] (Function) is not equal to "UART" then the test is not passed
Should Be Equal ${ResultComponents}[2] Send => If ${ResultComponents}[2] (Command) is not equal to "Send" then the test is not passed
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo} => If ${ResultComponents}[3] (ErrorInformation) is not equal to "${ERROR_NoInfo} (00)" then the test is not passed
This function retrieves the ISR (Interrupt Service Routine) receive buffer of the UART
This command may invoke FH_UART_Receive_UART01 to FH_UART_Receive_UART08
| Send Message Body | Description |
|---|---|
| DeviceAddress | It shall be equal to the address of the device (FH_RFCommunication_DeviceAddress) |
| Function | Function_UART (0x06) |
| Command | UART_Commands_Receive (0x02) |
| MessageDataLength | 1 byte (0x01) |
| MessageData | UART Input Number (0x01 for UART01 to 0x08 for UART08) |
| Checksum | Sum of all the bytes (For user-friendly design purposes, not implemented => always 0xAA) |
| Result Message Body | Description |
|---|---|
| DeviceAddress (2 bytes) | Ascii equivalent of the hex address of the device (FH_RFCommunication_DeviceAddress) |
| Function (4 bytes) | "UART" |
| Command (7 bytes) | "Receive" |
| MessageData1 (2 bytes) | Ascii equivalent of the hex value of the Error Code (XX) in FH_ErrorInfo.h |
| MessageData2 (2 bytes) | Ascii equivalent of the hex value of the UART receive buffer index value (Length of the received data) |
| MessageData3 (2 bytes) | Ascii equivalent of the hex value of the UART receive buffer value byte 1 |
| MessageData... (2 bytes) | Ascii equivalent of the hex value of the UART receive buffer value byte ... |
| MessageDataN (2 bytes) | Ascii equivalent of the hex value of the UART receive buffer value byte N |
==============================================================================
##### RobotFramework Example #####
==============================================================================
@{MessageData} = Create List ${UART01}
&{Message} = Create Dictionary DeviceAddress=${DeviceAddress_01} Function=${Function_UART} Command=${UART_Commands_Receive} Data=@{MessageData}
${Result} SendMessage &{Message}
Log Many Result = ${Result}
@{ResultComponents}= split string ${Result} |
Log Many DeviceAddress = ${ResultComponents}[0]
Log Many Function = ${ResultComponents}[1]
Log Many Command = ${ResultComponents}[2]
Log Many ErrorInformation = ${ResultComponents}[3]
Log Many DataLength = ${ResultComponents}[4]
Log Many Data = ${ResultComponents}[5]
Should Be Equal ${ResultComponents}[0] 01
Should Be Equal ${ResultComponents}[1] UART
Should Be Equal ${ResultComponents}[2] Receive
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo}
Should Be Equal ${ResultComponents}[4] 04
Should Be Equal ${ResultComponents}[5] ABCDabcd
Comments:
UART01 => It indicates the UART 01
DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
Function_UART => It is the function in the message frame
UART_Commands_Receive => It is the command of the function in the message frame
Result Example:
Log Many Result = ${Result} => 01|UART|Receive|00|04|ABCDabcd
@{ResultComponents}= split string ${Result} | => Split the result elements string by |
Log Many DeviceAddress = ${ResultComponents}[0] => DeviceAddress = 01
Log Many Function = ${ResultComponents}[1] => Function = UART
Log Many Command = ${ResultComponents}[2] => Command = Receive
Log Many ErrorInformation = ${ResultComponents}[3] => ErrorInformation = 00 (ERROR_NoInfo)
Should Be Equal ${ResultComponents}[0] 01 => If ${ResultComponents}[0] (DeviceAddress) is not equal to "01" then the test is not passed
Should Be Equal ${ResultComponents}[1] UART => If ${ResultComponents}[1] (Function) is not equal to "UART" then the test is not passed
Should Be Equal ${ResultComponents}[2] Receive => If ${ResultComponents}[2] (Command) is not equal to "Receive" then the test is not passed
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo} => If ${ResultComponents}[3] (ErrorInformation) is not equal to "${ERROR_NoInfo} (00)" then the test is not passed
Should Be Equal ${ResultComponents}[4] 04 => If ${ResultComponents}[4] (Received data length) is not equal to "04" then the test is not passed
Should Be Equal ${ResultComponents}[5] ABCDabcd => If ${ResultComponents}[5] (Received data) is not equal to "ABCDabcd" then the test is not passed
This function waits to receive the specified number of bytes of data through the ISR (Interrupt Service Routine) receive buffer of the UART
This command may invoke FH_UART_ReceiveW_UART01 to FH_UART_ReceiveW_UART08
| Send Message Body | Description |
|---|---|
| DeviceAddress | It shall be equal to the address of the device (FH_RFCommunication_DeviceAddress) |
| Function | Function_UART (0x06) |
| Command | FH_UART_Commands_ReceiveW (0x03) |
| MessageDataLength | 6 bytes (0x06) |
| MessageData1 | UART Input Number (0x01 for UART01 to 0x08 for UART08) |
| MessageData2 | The expected number of bytes of data to be received (Example: 5 bytes => 0x05)) |
| MessageData3 | The timeout of receiving the expected number of bytes in mili seconds, Byte 4 |
| MessageData4 | The timeout of receiving the expected number of bytes in mili seconds, Byte 3 |
| MessageData5 | The timeout of receiving the expected number of bytes in mili seconds, Byte 2 |
| MessageData6 | The timeout of receiving the expected number of bytes in mili seconds, Byte 1 |
| Checksum | Sum of all the bytes (For user-friendly design purposes, not implemented => always 0xAA) |
| Result Message Body | Description |
|---|---|
| DeviceAddress (2 bytes) | Ascii equivalent of the hex address of the device (FH_RFCommunication_DeviceAddress) |
| Function (4 bytes) | "UART" |
| Command (7 bytes) | "ReceiveW" |
| MessageData1 (2 bytes) | Ascii equivalent of the hex value of the Error Code (XX) in FH_ErrorInfo.h |
| MessageData2 (2 bytes) | Ascii equivalent of the hex value of the UART receive buffer index value (Length of the received data) |
| MessageData3 (2 bytes) | Ascii equivalent of the hex value of the UART receive buffer value byte 1 |
| MessageData... (2 bytes) | Ascii equivalent of the hex value of the UART receive buffer value byte ... |
| MessageDataN (2 bytes) | Ascii equivalent of the hex value of the UART receive buffer value byte N |
==============================================================================
##### RobotFramework Example #####
==============================================================================
@{MessageData} = Create List ${UART01} 05 00 00 0B B8
&{Message} = Create Dictionary DeviceAddress=${DeviceAddress_01} Function=${Function_UART} Command=${UART_Commands_ReceiveW} Data=@{MessageData}
${Result} SendMessage &{Message}
Log Many Result = ${Result}
@{ResultComponents}= split string ${Result} |
Log Many DeviceAddress = ${ResultComponents}[0]
Log Many Function = ${ResultComponents}[1]
Log Many Command = ${ResultComponents}[2]
Log Many ErrorInformation = ${ResultComponents}[3]
Log Many DataLength = ${ResultComponents}[4]
Log Many Data = ${ResultComponents}[5]
Should Be Equal ${ResultComponents}[0] 01
Should Be Equal ${ResultComponents}[1] UART
Should Be Equal ${ResultComponents}[2] ReceiveW
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo}
Should Be Equal ${ResultComponents}[4] 04
Should Be Equal ${ResultComponents}[5] ABCDabcd
Comments:
UART01 => It indicates the UART 01
05 => The expected number of bytes of data to be received through the <b>ISR</b> (Interrupt Service Routine) receive buffer (FH_UART01_ReceiveBuf) of the <b>UART 01</b>
00 00 0B B8 => Example data (0x00000BB8 milliseconds) as timeout of receiving the expected number of bytes
FH_GlobalTimeCounter which is a global variable is utilized to calculate the timeout
FH_GlobalTimeCounter shall be incremented every <b>1 millisecond</b> in an interested timer <b>ISR</b> (Interrupt Service Routine) by <b>FH</b> user
For this to happen, <b>FH_GlobalTimerCount.h</b> shall be included in the interested timer <b>ISR</b> (Interrupt Service Routine) file
If the expected number of bytes are received, the function does not wait anymore for the remaining time of the timeout
DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
Function_UART => It is the function in the message frame
UART_Commands_ReceiveW => It is the command of the function in the message frame
Result Example:
Log Many Result = ${Result} => 01|UART|ReceiveW|00|04|ABCDabcd
@{ResultComponents}= split string ${Result} | => Split the result elements string by |
Log Many DeviceAddress = ${ResultComponents}[0] => DeviceAddress = 01
Log Many Function = ${ResultComponents}[1] => Function = UART
Log Many Command = ${ResultComponents}[2] => Command = ReceiveW
Log Many ErrorInformation = ${ResultComponents}[3] => ErrorInformation = 00 (ERROR_NoInfo)
Should Be Equal ${ResultComponents}[0] 01 => If ${ResultComponents}[0] (DeviceAddress) is not equal to "01" then the test is not passed
Should Be Equal ${ResultComponents}[1] UART => If ${ResultComponents}[1] (Function) is not equal to "UART" then the test is not passed
Should Be Equal ${ResultComponents}[2] ReceiveW => If ${ResultComponents}[2] (Command) is not equal to "ReceiveW" then the test is not passed
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo} => If ${ResultComponents}[3] (ErrorInformation) is not equal to "${ERROR_NoInfo} (00)" then the test is not passed
Should Be Equal ${ResultComponents}[4] 04 => If ${ResultComponents}[4] (Received data length) is not equal to "04" then the test is not passed
Should Be Equal ${ResultComponents}[5] ABCDabcd => If ${ResultComponents}[5] (Received data) is not equal to "ABCDabcd" then the test is not passed
This function resets the ISR (Interrupt Service Routine) receive buffer index of the UART
This command may invoke FH_UART_ResetRB_UART01 to FH_UART_ResetRB_UART08
| Send Message Body | Description |
|---|---|
| DeviceAddress | It shall be equal to the address of the device (FH_RFCommunication_DeviceAddress) |
| Function | Function_UART (0x06) |
| Command | FH_UART_Commands_ResetRB (0x04) |
| MessageDataLength | 1 bytes (0x01) |
| MessageData | UART Input Number (0x01 for UART01 to 0x08 for UART08) |
| Checksum | Sum of all the bytes (For user-friendly design purposes, not implemented => always 0xAA) |
| Result Message Body | Description |
|---|---|
| DeviceAddress (2 bytes) | Ascii equivalent of the hex address of the device (FH_RFCommunication_DeviceAddress) |
| Function (4 bytes) | "UART" |
| Command (7 bytes) | "ResetRB" |
| MessageData (2 bytes) | Ascii equivalent of the hex value of the Error Code (XX) in FH_ErrorInfo.h |
==============================================================================
##### RobotFramework Example #####
==============================================================================
@{MessageData} = Create List ${UART01}
&{Message} = Create Dictionary DeviceAddress=${DeviceAddress_01} Function=${Function_UART} Command=${UART_Commands_ResetRB} Data=@{MessageData}
${Result} SendMessage &{Message}
Log Many Result = ${Result}
@{ResultComponents}= split string ${Result} |
Log Many DeviceAddress = ${ResultComponents}[0]
Log Many Function = ${ResultComponents}[1]
Log Many Command = ${ResultComponents}[2]
Log Many ErrorInformation = ${ResultComponents}[3]
Should Be Equal ${ResultComponents}[0] 01
Should Be Equal ${ResultComponents}[1] UART
Should Be Equal ${ResultComponents}[2] ResetRB
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo}
Comments:
UART01 => It indicates the UART 01
DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
Function_UART => It is the function in the message frame
UART_Commands_ResetRB => It is the command of the function in the message frame
Result Example:
Log Many Result = ${Result} => 01|UART|ResetRB|00|
@{ResultComponents}= split string ${Result} | => Split the result elements string by |
Log Many DeviceAddress = ${ResultComponents}[0] => DeviceAddress = 01
Log Many Function = ${ResultComponents}[1] => Function = UART
Log Many Command = ${ResultComponents}[2] => Command = ResetRB
Log Many ErrorInformation = ${ResultComponents}[3] => ErrorInformation = 00 (ERROR_NoInfo)
Should Be Equal ${ResultComponents}[0] 01 => If ${ResultComponents}[0] (DeviceAddress) is not equal to "01" then the test is not passed
Should Be Equal ${ResultComponents}[1] UART => If ${ResultComponents}[1] (Function) is not equal to "UART" then the test is not passed
Should Be Equal ${ResultComponents}[2] ResetRB => If ${ResultComponents}[2] (Command) is not equal to "ResetRB" then the test is not passed
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo} => If ${ResultComponents}[3] (ErrorInformation) is not equal to "${ERROR_NoInfo} (00)" then the test is not passed
This function sets the shared data buffer (8 bit buffer) of the UART
This command may invoke FH_UART_SSD8_UART01 to FH_UART_SSD8_UART08
| Send Message Body | Description |
|---|---|
| DeviceAddress | It shall be equal to the address of the device (FH_RFCommunication_DeviceAddress) |
| Function | Function_UART (0x06) |
| Command | FH_UART_Commands_SSD8 (0x05) |
| MessageDataLength | N bytes (Example: N = 5 => 0x05) |
| MessageData1 | UART Number (0x01 for UART01 to 0x08 for UART08) |
| MessageData2 | Length of the data to be set |
| MessageData3 | Data1 to be set |
| MessageData... | Data... to be set |
| MessageDataN | DataN to be set |
| Checksum | Sum of all the bytes (For user-friendly design purposes, not implemented => always 0xAA) |
| Result Message Body | Description |
|---|---|
| DeviceAddress (2 bytes) | Ascii equivalent of the hex address of the device (FH_RFCommunication_DeviceAddress) |
| Function (4 bytes) | "UART" |
| Command (4 bytes) | "SSD8" |
| MessageData (2 bytes) | Ascii equivalent of the hex value of the Error Code (XX) in FH_ErrorInfo.h |
==============================================================================
##### RobotFramework Example #####
==============================================================================
@{MessageData} = Create List ${UART01} 04 AA BB CC DD
&{Message} = Create Dictionary DeviceAddress=${DeviceAddress_01} Function=${Function_UART} Command=${UART_Commands_SSD8} Data=@{MessageData}
${Result} SendMessage &{Message}
Log Many Result = ${Result}
@{ResultComponents}= split string ${Result} |
Log Many DeviceAddress = ${ResultComponents}[0]
Log Many Function = ${ResultComponents}[1]
Log Many Command = ${ResultComponents}[2]
Log Many ErrorInformation = ${ResultComponents}[3]
Should Be Equal ${ResultComponents}[0] 01
Should Be Equal ${ResultComponents}[1] UART
Should Be Equal ${ResultComponents}[2] SSD8
Should Be Equal ${ResultComponents}[3] ${ERROR_Ok}
Comments:
UART01 => It indicates the UART 01
04 => Example interested length of the 8 bit data to be set
AA BB CC DD => Example data (0xAA, 0xBB, 0xCC, 0xDD) to be set in <b>FH_UART01_SharedDataBuf_8Bits</b>
DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
Function_UART => It is the function in the message frame
UART_Commands_SSD8 => It is the command of the function in the message frame
Result Example:
Log Many Result = ${Result} => 01|UART|SSD8|01|
@{ResultComponents}= split string ${Result} | => Split the result elements string by |
Log Many DeviceAddress = ${ResultComponents}[0] => DeviceAddress = 01
Log Many Function = ${ResultComponents}[1] => Function = UART
Log Many Command = ${ResultComponents}[2] => Command = SSD8
Log Many ErrorInformation = ${ResultComponents}[3] => ErrorInformation = 00 (ERROR_NoInfo)
Should Be Equal ${ResultComponents}[0] 01 => If ${ResultComponents}[0] (DeviceAddress) is not equal to "01" then the test is not passed
Should Be Equal ${ResultComponents}[1] UART => If ${ResultComponents}[1] (Function) is not equal to "UART" then the test is not passed
Should Be Equal ${ResultComponents}[2] SSD8 => If ${ResultComponents}[2] (Command) is not equal to "SSD8" then the test is not passed
Should Be Equal ${ResultComponents}[3] ${ERROR_Ok} => If ${ResultComponents}[3] (ErrorInformation) is not equal to "${ERROR_Ok} (01)" then the test is not passed
This function sets the shared data buffer (16 bit buffer) of the UART
This command may invoke FH_UART_SSD16_UART01 to FH_UART_SSD16_UART08
| Send Message Body | Description |
|---|---|
| DeviceAddress | It shall be equal to the address of the device (FH_RFCommunication_DeviceAddress) |
| Function | Function_UART (0x06) |
| Command | FH_UART_Commands_SSD16 (0x06) |
| MessageDataLength | N bytes (Example: N = 5 => 0x05) |
| MessageData1 | UART Number (0x01 for UART01 to 0x08 for UART08) |
| MessageData2 | Length of the data to be set |
| MessageData3 | Data1 byte1 (high byte) to be set |
| MessageData4 | Data1 byte2 (low byte)to be set |
| MessageData5 | Data2 byte1 (high byte) to be set |
| MessageData6 | Data2 byte2 (low byte)to be set |
| MessageData... | Data... byte1 (high byte) to be set |
| MessageData... | Data... byte2 (low byte) to be set |
| MessageDataN-1 | DataN byte1 (high byte) to be set |
| MessageDataN | DataN byte2 (low byte) to be set |
| Checksum | Sum of all the bytes (For user-friendly design purposes, not implemented => always 0xAA) |
| Result Message Body | Description |
|---|---|
| DeviceAddress (2 bytes) | Ascii equivalent of the hex address of the device (FH_RFCommunication_DeviceAddress) |
| Function (4 bytes) | "UART" |
| Command (4 bytes) | "SSD16" |
| MessageData (2 bytes) | Ascii equivalent of the hex value of the Error Code (XX) in FH_ErrorInfo.h |
==============================================================================
##### RobotFramework Example #####
==============================================================================
@{MessageData} = Create List ${UART01} 02 AA BB CC DD
&{Message} = Create Dictionary DeviceAddress=${DeviceAddress_01} Function=${Function_UART} Command=${UART_Commands_SSD16} Data=@{MessageData}
${Result} SendMessage &{Message}
Log Many Result = ${Result}
@{ResultComponents}= split string ${Result} |
Log Many DeviceAddress = ${ResultComponents}[0]
Log Many Function = ${ResultComponents}[1]
Log Many Command = ${ResultComponents}[2]
Log Many ErrorInformation = ${ResultComponents}[3]
Should Be Equal ${ResultComponents}[0] 01
Should Be Equal ${ResultComponents}[1] UART
Should Be Equal ${ResultComponents}[2] SSD16
Should Be Equal ${ResultComponents}[3] ${ERROR_Ok}
Comments:
UART01 => It indicates the UART 01
02 => Example interested length of the 16 bit data to be set
AA BB CC DD => Example data (0xAABB and 0xCCDD) to be set in <b>FH_UART01_SharedDataBuf_16Bits</b>
DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
Function_UART => It is the function in the message frame
UART_Commands_SSD16 => It is the command of the function in the message frame
Result Example:
Log Many Result = ${Result} => 01|UART|SSD16|01|
@{ResultComponents}= split string ${Result} | => Split the result elements string by |
Log Many DeviceAddress = ${ResultComponents}[0] => DeviceAddress = 01
Log Many Function = ${ResultComponents}[1] => Function = UART
Log Many Command = ${ResultComponents}[2] => Command = SSD16
Log Many ErrorInformation = ${ResultComponents}[3] => ErrorInformation = 00 (ERROR_NoInfo)
Should Be Equal ${ResultComponents}[0] 01 => If ${ResultComponents}[0] (DeviceAddress) is not equal to "01" then the test is not passed
Should Be Equal ${ResultComponents}[1] UART => If ${ResultComponents}[1] (Function) is not equal to "UART" then the test is not passed
Should Be Equal ${ResultComponents}[2] SSD16 => If ${ResultComponents}[2] (Command) is not equal to "SSD16" then the test is not passed
Should Be Equal ${ResultComponents}[3] ${ERROR_Ok} => If ${ResultComponents}[3] (ErrorInformation) is not equal to "${ERROR_Ok} (01)" then the test is not passed
This function sets the shared data buffer (32 bit buffer) of the UART
This command may invoke FH_UART_SSD32_UART01 to FH_UART_SSD32_UART08
| Send Message Body | Description |
|---|---|
| DeviceAddress | It shall be equal to the address of the device (FH_RFCommunication_DeviceAddress) |
| Function | Function_UART (0x06) |
| Command | FH_UART_Commands_SSD32 (0x07) |
| MessageDataLength | N bytes (Example: N = 5 => 0x05) |
| MessageData1 | UART Number (0x01 for UART01 to 0x08 for UART08) |
| MessageData2 | Length of the data to be set |
| MessageData3 | Data1 byte1 (4th byte) to be set |
| MessageData4 | Data1 byte2 (3rd byte)to be set |
| MessageData5 | Data1 byte3 (2nd byte) to be set |
| MessageData6 | Data1 byte4 (1st byte)to be set |
| MessageData3 | Data2 byte1 (4th byte) to be set |
| MessageData4 | Data2 byte2 (3rd byte)to be set |
| MessageData5 | Data2 byte3 (2nd byte) to be set |
| MessageData6 | Data2 byte4 (1st byte)to be set |
| MessageData... | Data... byte1 (4th byte) to be set |
| MessageData... | Data... byte2 (3rd byte) to be set |
| MessageData... | Data... byte3 (2nd byte) to be set |
| MessageData... | Data... byte4 (1st byte) to be set |
| MessageDataN-3 | DataN byte1 (4th byte) to be set |
| MessageDataN-2 | DataN byte2 (3rd byte) to be set |
| MessageDataN-1 | DataN byte3 (2nd byte) to be set |
| MessageDataN | DataN byte4 (1st byte) to be set |
| Checksum | Sum of all the bytes (For user-friendly design purposes, not implemented => always 0xAA) |
| Result Message Body | Description |
|---|---|
| DeviceAddress (2 bytes) | Ascii equivalent of the hex address of the device (FH_RFCommunication_DeviceAddress) |
| Function (4 bytes) | "UART" |
| Command (4 bytes) | "SSD32" |
| MessageData (2 bytes) | Ascii equivalent of the hex value of the Error Code (XX) in FH_ErrorInfo.h |
==============================================================================
##### RobotFramework Example #####
==============================================================================
@{MessageData} = Create List ${UART01} 02 AA BB CC DD 01 02 03 04
&{Message} = Create Dictionary DeviceAddress=${DeviceAddress_01} Function=${Function_UART} Command=${UART_Commands_SSD32} Data=@{MessageData}
${Result} SendMessage &{Message}
Log Many Result = ${Result}
@{ResultComponents}= split string ${Result} |
Log Many DeviceAddress = ${ResultComponents}[0]
Log Many Function = ${ResultComponents}[1]
Log Many Command = ${ResultComponents}[2]
Log Many ErrorInformation = ${ResultComponents}[3]
Should Be Equal ${ResultComponents}[0] 01
Should Be Equal ${ResultComponents}[1] UART
Should Be Equal ${ResultComponents}[2] SSD32
Should Be Equal ${ResultComponents}[3] ${ERROR_Ok}
Comments:
UART01 => It indicates the UART 01
02 => Example interested length of the 32 bit data to be set
AA BB CC DD 01 02 03 04 => Example data (0xAABBCCDD and 0x01020304) to be set in <b>FH_UART01_SharedDataBuf_32Bits</b>
DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
Function_UART => It is the function in the message frame
UART_Commands_SSD32 => It is the command of the function in the message frame
Result Example:
Log Many Result = ${Result} => 01|UART|SSD32|01|
@{ResultComponents}= split string ${Result} | => Split the result elements string by |
Log Many DeviceAddress = ${ResultComponents}[0] => DeviceAddress = 01
Log Many Function = ${ResultComponents}[1] => Function = UART
Log Many Command = ${ResultComponents}[2] => Command = SSD32
Log Many ErrorInformation = ${ResultComponents}[3] => ErrorInformation = 00 (ERROR_NoInfo)
Should Be Equal ${ResultComponents}[0] 01 => If ${ResultComponents}[0] (DeviceAddress) is not equal to "01" then the test is not passed
Should Be Equal ${ResultComponents}[1] UART => If ${ResultComponents}[1] (Function) is not equal to "UART" then the test is not passed
Should Be Equal ${ResultComponents}[2] SSD32 => If ${ResultComponents}[2] (Command) is not equal to "SSD32" then the test is not passed
Should Be Equal ${ResultComponents}[3] ${ERROR_Ok} => If ${ResultComponents}[3] (ErrorInformation) is not equal to "${ERROR_Ok} (01)" then the test is not passed
This function gets the shared data buffer (8 bit buffer) of the UART
This command may invoke FH_UART_GSD8_UART01 to FH_UART_GSD8_UART08
| Send Message Body | Description |
|---|---|
| DeviceAddress | It shall be equal to the address of the device (FH_RFCommunication_DeviceAddress) |
| Function | Function_UART (0x06) |
| Command | FH_UART_Commands_GSD8 (0x08) |
| MessageDataLength | 1 byte (0x01) |
| MessageData | UART Input Number (0x01 for UART01 to 0x08 for UART08) |
| Checksum | Sum of all the bytes (For user-friendly design purposes, not implemented => always 0xAA) |
| Result Message Body | Description |
|---|---|
| DeviceAddress (2 bytes) | Ascii equivalent of the hex address of the device (FH_RFCommunication_DeviceAddress) |
| Function (4 bytes) | "UART" |
| Command (7 bytes) | "GSD8" |
| MessageData1 (2 bytes) | Ascii equivalent of the hex value of the Error Code (XX) in FH_ErrorInfo.h |
| MessageData2 (2 bytes) | Ascii equivalent of the hex value of the UART shared data buffer index value (Length of the shared data buffer) |
| MessageData3 (2 bytes) | Ascii equivalent of the hex value of the UART shared data buffer value Data1 |
| MessageData... (2 bytes) | Ascii equivalent of the hex value of the UART shared data buffer value Data ... |
| MessageDataN (2 bytes) | Ascii equivalent of the hex value of the UART shared data buffer value DataN |
==============================================================================
##### RobotFramework Example #####
==============================================================================
@{MessageData} = Create List ${UART01}
&{Message} = Create Dictionary DeviceAddress=${DeviceAddress_01} Function=${Function_UART} Command=${UART_Commands_GSD8} Data=@{MessageData}
${Result} SendMessage &{Message}
Log Many Result = ${Result}
@{ResultComponents}= split string ${Result} |
Log Many DeviceAddress = ${ResultComponents}[0]
Log Many Function = ${ResultComponents}[1]
Log Many Command = ${ResultComponents}[2]
Log Many ErrorInformation = ${ResultComponents}[3]
Log Many DataLength = ${ResultComponents}[4]
Log Many Data = ${ResultComponents}[5]
Should Be Equal ${ResultComponents}[0] 01
Should Be Equal ${ResultComponents}[1] UART
Should Be Equal ${ResultComponents}[2] GSD8
Should Be Equal ${ResultComponents}[3] ${ERROR_Ok}
Should Be Equal ${ResultComponents}[4] 10
Should Be Equal ${ResultComponents}[5] aabbccdd000000000000000000000000
Comments:
UART01 => It indicates the UART 01
DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
Function_UART => It is the function in the message frame
UART_Commands_GSD8 => It is the command of the function in the message frame
Result Example:
Log Many Result = ${Result} => 01|UART|GSD8|01|10|aabbccdd000000000000000000000000
@{ResultComponents}= split string ${Result} | => Split the result elements string by |
Log Many DeviceAddress = ${ResultComponents}[0] => DeviceAddress = 01
Log Many Function = ${ResultComponents}[1] => Function = UART
Log Many Command = ${ResultComponents}[2] => Command = GSD8
Log Many ErrorInformation = ${ResultComponents}[3] => ErrorInformation = 00 (ERROR_NoInfo)
Should Be Equal ${ResultComponents}[0] 01 => If ${ResultComponents}[0] (DeviceAddress) is not equal to "01" then the test is not passed
Should Be Equal ${ResultComponents}[1] UART => If ${ResultComponents}[1] (Function) is not equal to "UART" then the test is not passed
Should Be Equal ${ResultComponents}[2] GSD8 => If ${ResultComponents}[2] (Command) is not equal to "GSD8" then the test is not passed
Should Be Equal ${ResultComponents}[3] ${ERROR_Ok} => If ${ResultComponents}[3] (ErrorInformation) is not equal to "${ERROR_Ok} (01)" then the test is not passed
Should Be Equal ${ResultComponents}[4] 10 => If ${ResultComponents}[4] (Shared data length) is not equal to "10" then the test is not passed
Should Be Equal ${ResultComponents}[5] aabbccdd000000000000000000000000 => If ${ResultComponents}[5] (Shared data) is not equal to "aabbccdd000000000000000000000000" then the test is not passed
This function gets the shared data buffer (16 bit buffer) of the UART
This command may invoke FH_UART_GSD16_UART01 to FH_UART_GSD16_UART08
| Send Message Body | Description |
|---|---|
| DeviceAddress | It shall be equal to the address of the device (FH_RFCommunication_DeviceAddress) |
| Function | Function_UART (0x06) |
| Command | FH_UART_Commands_GSD16 (0x09) |
| MessageDataLength | 1 byte (0x01) |
| MessageData | UART Input Number (0x01 for UART01 to 0x08 for UART08) |
| Checksum | Sum of all the bytes (For user-friendly design purposes, not implemented => always 0xAA) |
| Result Message Body | Description |
|---|---|
| DeviceAddress (2 bytes) | Ascii equivalent of the hex address of the device (FH_RFCommunication_DeviceAddress) |
| Function (4 bytes) | "UART" |
| Command (7 bytes) | "GSD16" |
| MessageData1 (2 bytes) | Ascii equivalent of the hex value of the Error Code (XX) in FH_ErrorInfo.h |
| MessageData2 (2 bytes) | Ascii equivalent of the hex value of the UART shared data buffer index value (Length of the shared data buffer) |
| MessageData3 (2 bytes) | Ascii equivalent of the hex value of the UART shared data buffer value Data1 byte 1 (high byte) |
| MessageData4 (2 bytes) | Ascii equivalent of the hex value of the UART shared data buffer value Data2 byte 2 (low byte) |
| MessageData... (2 bytes) | Ascii equivalent of the hex value of the UART shared data buffer value Data... byte 1 (high byte) |
| MessageData... (2 bytes) | Ascii equivalent of the hex value of the UART shared data buffer value Data... byte 2 (low byte) |
| MessageDataN-1 (2 bytes) | Ascii equivalent of the hex value of the UART shared data buffer value DataN-1 byte 1 (high byte) |
| MessageDataN (2 bytes) | Ascii equivalent of the hex value of the UART shared data buffer value DataN byte 2 (low byte) |
==============================================================================
##### RobotFramework Example #####
==============================================================================
@{MessageData} = Create List ${UART01}
&{Message} = Create Dictionary DeviceAddress=${DeviceAddress_01} Function=${Function_UART} Command=${UART_Commands_GSD16} Data=@{MessageData}
${Result} SendMessage &{Message}
Log Many Result = ${Result}
@{ResultComponents}= split string ${Result} |
Log Many DeviceAddress = ${ResultComponents}[0]
Log Many Function = ${ResultComponents}[1]
Log Many Command = ${ResultComponents}[2]
Log Many ErrorInformation = ${ResultComponents}[3]
Log Many DataLength = ${ResultComponents}[4]
Log Many Data = ${ResultComponents}[5]
Should Be Equal ${ResultComponents}[0] 01
Should Be Equal ${ResultComponents}[1] UART
Should Be Equal ${ResultComponents}[2] GSD16
Should Be Equal ${ResultComponents}[3] ${ERROR_Ok}
Should Be Equal ${ResultComponents}[4] 10
Should Be Equal ${ResultComponents}[5] aabbccdd000000000000000000000000
Comments:
UART01 => It indicates the UART 01
DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
Function_UART => It is the function in the message frame
UART_Commands_GSD16 => It is the command of the function in the message frame
Result Example:
Log Many Result = ${Result} => 01|UART|GSD16|01|10|aabbccdd000000000000000000000000
@{ResultComponents}= split string ${Result} | => Split the result elements string by |
Log Many DeviceAddress = ${ResultComponents}[0] => DeviceAddress = 01
Log Many Function = ${ResultComponents}[1] => Function = UART
Log Many Command = ${ResultComponents}[2] => Command = GSD16
Log Many ErrorInformation = ${ResultComponents}[3] => ErrorInformation = 00 (ERROR_NoInfo)
Should Be Equal ${ResultComponents}[0] 01 => If ${ResultComponents}[0] (DeviceAddress) is not equal to "01" then the test is not passed
Should Be Equal ${ResultComponents}[1] UART => If ${ResultComponents}[1] (Function) is not equal to "UART" then the test is not passed
Should Be Equal ${ResultComponents}[2] GSD16 => If ${ResultComponents}[2] (Command) is not equal to "GSD16" then the test is not passed
Should Be Equal ${ResultComponents}[3] ${ERROR_Ok} => If ${ResultComponents}[3] (ErrorInformation) is not equal to "${ERROR_Ok} (01)" then the test is not passed
Should Be Equal ${ResultComponents}[4] 10 => If ${ResultComponents}[4] (Shared data length) is not equal to "10" then the test is not passed
Should Be Equal ${ResultComponents}[5] aabbccdd000000000000000000000000 => If ${ResultComponents}[5] (Shared data) is not equal to "aabbccdd000000000000000000000000" then the test is not passed
This function gets the shared data buffer (32 bit buffer) of the UART
This command may invoke FH_UART_GSD32_UART01 to FH_UART_GSD32_UART08
| Send Message Body | Description |
|---|---|
| DeviceAddress | It shall be equal to the address of the device (FH_RFCommunication_DeviceAddress) |
| Function | Function_UART (0x06) |
| Command | FH_UART_Commands_GSD32 (0x0A) |
| MessageDataLength | 1 byte (0x01) |
| MessageData | UART Input Number (0x01 for UART01 to 0x08 for UART08) |
| Checksum | Sum of all the bytes (For user-friendly design purposes, not implemented => always 0xAA) |
| Result Message Body | Description |
|---|---|
| DeviceAddress (2 bytes) | Ascii equivalent of the hex address of the device (FH_RFCommunication_DeviceAddress) |
| Function (4 bytes) | "UART" |
| Command (7 bytes) | "GSD32" |
| MessageData1 (2 bytes) | Ascii equivalent of the hex value of the Error Code (XX) in FH_ErrorInfo.h |
| MessageData2 (2 bytes) | Ascii equivalent of the hex value of the UART shared data buffer index value (Length of the shared data buffer) |
| MessageData3 (2 bytes) | Ascii equivalent of the hex value of the UART shared data buffer value Data1 byte 1 (4th byte) |
| MessageData4 (2 bytes) | Ascii equivalent of the hex value of the UART shared data buffer value Data1 byte 2 (3rd byte) |
| MessageData5 (2 bytes) | Ascii equivalent of the hex value of the UART shared data buffer value Data1 byte 3 (2nd byte) |
| MessageData6 (2 bytes) | Ascii equivalent of the hex value of the UART shared data buffer value Data1 byte 4 (1st byte) |
| MessageData... (2 bytes) | Ascii equivalent of the hex value of the UART shared data buffer value Data... byte 1 (4th byte) |
| MessageData... (2 bytes) | Ascii equivalent of the hex value of the UART shared data buffer value Data... byte 2 (3rd byte) |
| MessageData... (2 bytes) | Ascii equivalent of the hex value of the UART shared data buffer value Data... byte 3 (2nd byte) |
| MessageData... (2 bytes) | Ascii equivalent of the hex value of the UART shared data buffer value Data... byte 4 (1st byte) |
| MessageDataN-3 (2 bytes) | Ascii equivalent of the hex value of the UART shared data buffer value DataN byte 1 (4th byte) |
| MessageDataN-2 (2 bytes) | Ascii equivalent of the hex value of the UART shared data buffer value DataN byte 2 (3rd byte) |
| MessageDataN-1 (2 bytes) | Ascii equivalent of the hex value of the UART shared data buffer value DataN byte 3 (2nd byte) |
| MessageDataN (2 bytes) | Ascii equivalent of the hex value of the UART shared data buffer value DataN byte 4 (1st byte) |
==============================================================================
##### RobotFramework Example #####
==============================================================================
@{MessageData} = Create List ${UART01}
&{Message} = Create Dictionary DeviceAddress=${DeviceAddress_01} Function=${Function_UART} Command=${UART_Commands_GSD32} Data=@{MessageData}
${Result} SendMessage &{Message}
Log Many Result = ${Result}
@{ResultComponents}= split string ${Result} |
Log Many DeviceAddress = ${ResultComponents}[0]
Log Many Function = ${ResultComponents}[1]
Log Many Command = ${ResultComponents}[2]
Log Many ErrorInformation = ${ResultComponents}[3]
Log Many DataLength = ${ResultComponents}[4]
Log Many Data = ${ResultComponents}[5]
Should Be Equal ${ResultComponents}[0] 01
Should Be Equal ${ResultComponents}[1] UART
Should Be Equal ${ResultComponents}[2] GSD32
Should Be Equal ${ResultComponents}[3] ${ERROR_Ok}
Should Be Equal ${ResultComponents}[4] 10
Should Be Equal ${ResultComponents}[5] aabbccdd010203040000000000000000
Comments:
UART01 => It indicates the UART 01
DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
Function_UART => It is the function in the message frame
UART_Commands_GSD32 => It is the command of the function in the message frame
Result Example:
Log Many Result = ${Result} => 01|UART|GSD32|01|10|aabbccdd010203040000000000000000
@{ResultComponents}= split string ${Result} | => Split the result elements string by |
Log Many DeviceAddress = ${ResultComponents}[0] => DeviceAddress = 01
Log Many Function = ${ResultComponents}[1] => Function = UART
Log Many Command = ${ResultComponents}[2] => Command = GSD32
Log Many ErrorInformation = ${ResultComponents}[3] => ErrorInformation = 00 (ERROR_NoInfo)
Should Be Equal ${ResultComponents}[0] 01 => If ${ResultComponents}[0] (DeviceAddress) is not equal to "01" then the test is not passed
Should Be Equal ${ResultComponents}[1] UART => If ${ResultComponents}[1] (Function) is not equal to "UART" then the test is not passed
Should Be Equal ${ResultComponents}[2] GSD32 => If ${ResultComponents}[2] (Command) is not equal to "GSD32" then the test is not passed
Should Be Equal ${ResultComponents}[3] ${ERROR_Ok} => If ${ResultComponents}[3] (ErrorInformation) is not equal to "${ERROR_Ok} (01)" then the test is not passed
Should Be Equal ${ResultComponents}[4] 10 => If ${ResultComponents}[4] (Shared data length) is not equal to "10" then the test is not passed
Should Be Equal ${ResultComponents}[5] aabbccdd010203040000000000000000 => If ${ResultComponents}[5] (Shared data) is not equal to "aabbccdd010203040000000000000000" then the test is not passed
Message | Description |
|---|---|
| CAN_Commands_Init | Initializes a CAN |
| CAN_Commands_Send | Sends data through the CAN |
| CAN_Commands_Receive | Retrieves the ISR (Interrupt Service Routine) receive buffer of the CAN |
| CAN_Commands_ReceiveW | Waits to receive the specified number of bytes of data through the ISR (Interrupt Service Routine) receive buffer of the CAN |
| CAN_Commands_ResetRB | Resets the ISR (Interrupt Service Routine) receive buffer index of the CAN |
| CAN_Commands_SSD8 | Sets the shared data buffer (8 bit buffer) of the CAN |
| CAN_Commands_SSD16 | Sets the shared data buffer (16 bit buffer) of the CAN |
| CAN_Commands_SSD32 | Sets the shared data buffer (32 bit buffer) of the CAN |
| CAN_Commands_GSSD8 | Gets the shared data buffer (8 bit buffer) of the CAN |
| CAN_Commands_GSD16 | Gets the shared data buffer (16 bit buffer) of the CAN |
| CAN_Commands_GSD32 | Gets the shared data buffer (32 bit buffer) of the CAN |
This command initializes a CAN
This command may invoke FH_CAN_Init_CAN01 to FH_CAN_Init_CAN08
| Send Message Body | Description |
|---|---|
| DeviceAddress | It shall be equal to the address of the device (FH_RFCommunication_DeviceAddress) |
| Function | Function_CAN (0x06) |
| Command | CAN_Commands_Init (0x00) |
| MessageDataLength | 1 byte (0x01) |
| MessageData | CAN Number (0x01 for CAN01 to 0x08 for CAN08) |
| Checksum | Sum of all the bytes (For user-friendly design purposes, not implemented => always 0xAA) |
| Result Message Body | Description |
|---|---|
| DeviceAddress (2 bytes) | Ascii equivalent of the hex address of the device (FH_RFCommunication_DeviceAddress) |
| Function (2 bytes) | "CAN" |
| Command (4 bytes) | "Init" |
| MessageData (2 bytes) | Ascii equivalent of the hex value of the Error Code (XX) in FH_ErrorInfo.h |
==============================================================================
##### RobotFramework Example #####
==============================================================================
@{MessageData} = Create List ${CAN01}
&{Message} = Create Dictionary DeviceAddress=${DeviceAddress_01} Function=${Function_CAN} Command=${CAN_Commands_Init} Data=@{MessageData}
${Result} SendMessage &{Message}
Log Many Result = ${Result}
@{ResultComponents}= split string ${Result} |
Log Many DeviceAddress = ${ResultComponents}[0]
Log Many Function = ${ResultComponents}[1]
Log Many Command = ${ResultComponents}[2]
Log Many ErrorInformation = ${ResultComponents}[3]
Should Be Equal ${ResultComponents}[0] 01
Should Be Equal ${ResultComponents}[1] CAN
Should Be Equal ${ResultComponents}[2] Init
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo}
Comments:
CAN01 => It indicates the CAN 01
DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
Function_CAN => It is the function in the message frame
CAN_Commands_Init => It is the command of the function in the message frame
Result Example:
Log Many Result = ${Result} => 01|CAN|Init|00|
@{ResultComponents}= split string ${Result} | => Split the result elements string by |
Log Many DeviceAddress = ${ResultComponents}[0] => DeviceAddress = 01
Log Many Function = ${ResultComponents}[1] => Function = CAN
Log Many Command = ${ResultComponents}[2] => Command = Init
Log Many ErrorInformation = ${ResultComponents}[3] => ErrorInformation = 00 (ERROR_NoInfo)
Should Be Equal ${ResultComponents}[0] 01 => If ${ResultComponents}[0] (DeviceAddress) is not equal to "01" then the test is not passed
Should Be Equal ${ResultComponents}[1] CAN => If ${ResultComponents}[1] (Function) is not equal to "CAN" then the test is not passed
Should Be Equal ${ResultComponents}[2] Init => If ${ResultComponents}[2] (Command) is not equal to "Init" then the test is not passed
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo} => If ${ResultComponents}[3] (ErrorInformation) is not equal to "${ERROR_NoInfo} (00)" then the test is not passed
This command sends data through the CAN
This command may invoke FH_CAN_Send_CAN01 to FH_CAN_Send_CAN08
| Send Message Body | Description |
|---|---|
| DeviceAddress | It shall be equal to the address of the device (FH_RFCommunication_DeviceAddress) |
| Function | Function_CAN (0x06) |
| Command | CAN_Commands_Send (0x01) |
| MessageDataLength | N bytes (Example: N = 5 => 0x05) |
| MessageData1 | CAN Number (0x01 for CAN01 to 0x08 for CAN08) |
| MessageData2 | Length of the data to be sent |
| MessageData3 | Data byte1 to be sent |
| MessageData... | Data byte... to be sent |
| MessageDataN | Data byteN to be sent |
| Checksum | Sum of all the bytes (For user-friendly design purposes, not implemented => always 0xAA) |
| Result Message Body | Description |
|---|---|
| DeviceAddress (2 bytes) | Ascii equivalent of the hex address of the device (FH_RFCommunication_DeviceAddress) |
| Function (4 bytes) | "CAN" |
| Command (4 bytes) | "Send" |
| MessageData (2 bytes) | Ascii equivalent of the hex value of the Error Code (XX) in FH_ErrorInfo.h |
==============================================================================
##### RobotFramework Example #####
==============================================================================
@{MessageData} = Create List ${CAN01} 02 B1 FF
&{Message} = Create Dictionary DeviceAddress=${DeviceAddress_01} Function=${Function_CAN} Command=${CAN_Commands_Send} Data=@{MessageData}
${Result} SendMessage &{Message}
Log Many Result = ${Result}
@{ResultComponents}= split string ${Result} |
Log Many DeviceAddress = ${ResultComponents}[0]
Log Many Function = ${ResultComponents}[1]
Log Many Command = ${ResultComponents}[2]
Log Many ErrorInformation = ${ResultComponents}[3]
Should Be Equal ${ResultComponents}[0] 01
Should Be Equal ${ResultComponents}[1] CAN
Should Be Equal ${ResultComponents}[2] Send
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo}
Comments:
CAN01 => It indicates the CAN 01
02 => Example length of the data to be sent
B1 FF => Example data (0xB1, 0xFF) to be sent (or apart from the data to be sent, it may include some other data like ID, Filter, ... to be processed too, if need be) through the <b>CAN 01</b>\n
DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
Function_CAN => It is the function in the message frame
CAN_Commands_Send => It is the command of the function in the message frame
Result Example:
Log Many Result = ${Result} => 01|CAN|Send|00|
@{ResultComponents}= split string ${Result} | => Split the result elements string by |
Log Many DeviceAddress = ${ResultComponents}[0] => DeviceAddress = 01
Log Many Function = ${ResultComponents}[1] => Function = CAN
Log Many Command = ${ResultComponents}[2] => Command = Send
Log Many ErrorInformation = ${ResultComponents}[3] => ErrorInformation = 00 (ERROR_NoInfo)
Should Be Equal ${ResultComponents}[0] 01 => If ${ResultComponents}[0] (DeviceAddress) is not equal to "01" then the test is not passed
Should Be Equal ${ResultComponents}[1] CAN => If ${ResultComponents}[1] (Function) is not equal to "CAN" then the test is not passed
Should Be Equal ${ResultComponents}[2] Send => If ${ResultComponents}[2] (Command) is not equal to "Send" then the test is not passed
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo} => If ${ResultComponents}[3] (ErrorInformation) is not equal to "${ERROR_NoInfo} (00)" then the test is not passed
This function retrieves the ISR (Interrupt Service Routine) receive buffer of the CAN
This command may invoke FH_CAN_Receive_CAN01 to FH_CAN_Receive_CAN08
| Send Message Body | Description |
|---|---|
| DeviceAddress | It shall be equal to the address of the device (FH_RFCommunication_DeviceAddress) |
| Function | Function_CAN (0x06) |
| Command | CAN_Commands_Receive (0x02) |
| MessageDataLength | 1 byte (0x01) |
| MessageData | CAN Input Number (0x01 for CAN01 to 0x08 for CAN08) |
| Checksum | Sum of all the bytes (For user-friendly design purposes, not implemented => always 0xAA) |
| Result Message Body | Description |
|---|---|
| DeviceAddress (2 bytes) | Ascii equivalent of the hex address of the device (FH_RFCommunication_DeviceAddress) |
| Function (4 bytes) | "CAN" |
| Command (7 bytes) | "Receive" |
| MessageData1 (2 bytes) | Ascii equivalent of the hex value of the Error Code (XX) in FH_ErrorInfo.h |
| MessageData2 (2 bytes) | Ascii equivalent of the hex value of the CAN receive buffer index value (Length of the received data) |
| MessageData3 (2 bytes) | Ascii equivalent of the hex value of the CAN receive buffer value byte 1 |
| MessageData... (2 bytes) | Ascii equivalent of the hex value of the CAN receive buffer value byte ... |
| MessageDataN (2 bytes) | Ascii equivalent of the hex value of the CAN receive buffer value byte N |
==============================================================================
##### RobotFramework Example #####
==============================================================================
@{MessageData} = Create List ${CAN01}
&{Message} = Create Dictionary DeviceAddress=${DeviceAddress_01} Function=${Function_CAN} Command=${CAN_Commands_Receive} Data=@{MessageData}
${Result} SendMessage &{Message}
Log Many Result = ${Result}
@{ResultComponents}= split string ${Result} |
Log Many DeviceAddress = ${ResultComponents}[0]
Log Many Function = ${ResultComponents}[1]
Log Many Command = ${ResultComponents}[2]
Log Many ErrorInformation = ${ResultComponents}[3]
Log Many DataLength = ${ResultComponents}[4]
Log Many Data = ${ResultComponents}[5]
Should Be Equal ${ResultComponents}[0] 01
Should Be Equal ${ResultComponents}[1] CAN
Should Be Equal ${ResultComponents}[2] Receive
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo}
Should Be Equal ${ResultComponents}[4] 04
Should Be Equal ${ResultComponents}[5] ABCDabcd
Comments:
CAN01 => It indicates the CAN 01
DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
Function_CAN => It is the function in the message frame
CAN_Commands_Receive => It is the command of the function in the message frame
Result Example:
Log Many Result = ${Result} => 01|CAN|Receive|00|04|ABCDabcd
@{ResultComponents}= split string ${Result} | => Split the result elements string by |
Log Many DeviceAddress = ${ResultComponents}[0] => DeviceAddress = 01
Log Many Function = ${ResultComponents}[1] => Function = CAN
Log Many Command = ${ResultComponents}[2] => Command = Receive
Log Many ErrorInformation = ${ResultComponents}[3] => ErrorInformation = 00 (ERROR_NoInfo)
Should Be Equal ${ResultComponents}[0] 01 => If ${ResultComponents}[0] (DeviceAddress) is not equal to "01" then the test is not passed
Should Be Equal ${ResultComponents}[1] CAN => If ${ResultComponents}[1] (Function) is not equal to "CAN" then the test is not passed
Should Be Equal ${ResultComponents}[2] Receive => If ${ResultComponents}[2] (Command) is not equal to "Receive" then the test is not passed
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo} => If ${ResultComponents}[3] (ErrorInformation) is not equal to "${ERROR_NoInfo} (00)" then the test is not passed
Should Be Equal ${ResultComponents}[4] 04 => If ${ResultComponents}[4] (Received data length) is not equal to "04" then the test is not passed
Should Be Equal ${ResultComponents}[5] ABCDabcd => If ${ResultComponents}[5] (Received data) is not equal to "ABCDabcd" then the test is not passed
This function waits to receive the specified number of bytes of data through the ISR (Interrupt Service Routine) receive buffer of the CAN
This command may invoke FH_CAN_ReceiveW_CAN01 to FH_CAN_ReceiveW_CAN08
| Send Message Body | Description |
|---|---|
| DeviceAddress | It shall be equal to the address of the device (FH_RFCommunication_DeviceAddress) |
| Function | Function_CAN (0x06) |
| Command | FH_CAN_Commands_ReceiveW (0x03) |
| MessageDataLength | 6 bytes (0x06) |
| MessageData1 | CAN Input Number (0x01 for CAN01 to 0x08 for CAN08) |
| MessageData2 | The expected number of bytes of data to be received (Example: 5 bytes => 0x05)) |
| MessageData3 | The timeout of receiving the expected number of bytes in mili seconds, Byte 4 |
| MessageData4 | The timeout of receiving the expected number of bytes in mili seconds, Byte 3 |
| MessageData5 | The timeout of receiving the expected number of bytes in mili seconds, Byte 2 |
| MessageData6 | The timeout of receiving the expected number of bytes in mili seconds, Byte 1 |
| Checksum | Sum of all the bytes (For user-friendly design purposes, not implemented => always 0xAA) |
| Result Message Body | Description |
|---|---|
| DeviceAddress (2 bytes) | Ascii equivalent of the hex address of the device (FH_RFCommunication_DeviceAddress) |
| Function (4 bytes) | "CAN" |
| Command (7 bytes) | "ReceiveW" |
| MessageData1 (2 bytes) | Ascii equivalent of the hex value of the Error Code (XX) in FH_ErrorInfo.h |
| MessageData2 (2 bytes) | Ascii equivalent of the hex value of the CAN receive buffer index value (Length of the received data) |
| MessageData3 (2 bytes) | Ascii equivalent of the hex value of the CAN receive buffer value byte 1 |
| MessageData... (2 bytes) | Ascii equivalent of the hex value of the CAN receive buffer value byte ... |
| MessageDataN (2 bytes) | Ascii equivalent of the hex value of the CAN receive buffer value byte N |
==============================================================================
##### RobotFramework Example #####
==============================================================================
@{MessageData} = Create List ${CAN01} 05 00 00 0B B8
&{Message} = Create Dictionary DeviceAddress=${DeviceAddress_01} Function=${Function_CAN} Command=${CAN_Commands_ReceiveW} Data=@{MessageData}
${Result} SendMessage &{Message}
Log Many Result = ${Result}
@{ResultComponents}= split string ${Result} |
Log Many DeviceAddress = ${ResultComponents}[0]
Log Many Function = ${ResultComponents}[1]
Log Many Command = ${ResultComponents}[2]
Log Many ErrorInformation = ${ResultComponents}[3]
Log Many DataLength = ${ResultComponents}[4]
Log Many Data = ${ResultComponents}[5]
Should Be Equal ${ResultComponents}[0] 01
Should Be Equal ${ResultComponents}[1] CAN
Should Be Equal ${ResultComponents}[2] ReceiveW
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo}
Should Be Equal ${ResultComponents}[4] 05
Should Be Equal ${ResultComponents}[5] ABCDabcd
Comments:
CAN01 => It indicates the CAN 01
05 => The expected number of bytes of data to be received through the <b>ISR</b> (Interrupt Service Routine) receive buffer (FH_CAN01_ReceiveBuf) of the <b>CAN 01</b>
00 00 0B B8 => Example data (0x00000BB8 milliseconds) as timeout of receiving the expected number of bytes
FH_GlobalTimeCounter which is a global variable is utilized to calculate the timeout
FH_GlobalTimeCounter shall be incremented every <b>1 millisecond</b> in an interested timer <b>ISR</b> (Interrupt Service Routine) by <b>FH</b> user
For this to happen, <b>FH_GlobalTimerCount.h</b> shall be included in the interested timer <b>ISR</b> (Interrupt Service Routine) file
If the expected number of bytes are received, the function does not wait anymore for the remaining time of the timeout
DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
Function_CAN => It is the function in the message frame
CAN_Commands_ReceiveW => It is the command of the function in the message frame
Result Example:
Log Many Result = ${Result} => 01|CAN|ReceiveW|00|04|ABCDabcd
@{ResultComponents}= split string ${Result} | => Split the result elements string by |
Log Many DeviceAddress = ${ResultComponents}[0] => DeviceAddress = 01
Log Many Function = ${ResultComponents}[1] => Function = CAN
Log Many Command = ${ResultComponents}[2] => Command = ReceiveW
Log Many ErrorInformation = ${ResultComponents}[3] => ErrorInformation = 00 (ERROR_NoInfo)
Should Be Equal ${ResultComponents}[0] 01 => If ${ResultComponents}[0] (DeviceAddress) is not equal to "01" then the test is not passed
Should Be Equal ${ResultComponents}[1] CAN => If ${ResultComponents}[1] (Function) is not equal to "CAN" then the test is not passed
Should Be Equal ${ResultComponents}[2] ReceiveW => If ${ResultComponents}[2] (Command) is not equal to "ReceiveW" then the test is not passed
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo} => If ${ResultComponents}[3] (ErrorInformation) is not equal to "${ERROR_NoInfo} (00)" then the test is not passed
Should Be Equal ${ResultComponents}[4] 04 => If ${ResultComponents}[4] (Received data length) is not equal to "04" then the test is not passed
Should Be Equal ${ResultComponents}[5] ABCDabcd => If ${ResultComponents}[5] (Received data) is not equal to "ABCDabcd" then the test is not passed
This function resets the ISR (Interrupt Service Routine) receive buffer index of the CAN
This command may invoke FH_CAN_ResetRB_CAN01 to FH_CAN_ResetRB_CAN08
| Send Message Body | Description |
|---|---|
| DeviceAddress | It shall be equal to the address of the device (FH_RFCommunication_DeviceAddress) |
| Function | Function_CAN (0x06) |
| Command | FH_CAN_Commands_ResetRB (0x04) |
| MessageDataLength | 1 bytes (0x01) |
| MessageData | CAN Input Number (0x01 for CAN01 to 0x08 for CAN08) |
| Checksum | Sum of all the bytes (For user-friendly design purposes, not implemented => always 0xAA) |
| Result Message Body | Description |
|---|---|
| DeviceAddress (2 bytes) | Ascii equivalent of the hex address of the device (FH_RFCommunication_DeviceAddress) |
| Function (4 bytes) | "CAN" |
| Command (7 bytes) | "ResetRB" |
| MessageData (2 bytes) | Ascii equivalent of the hex value of the Error Code (XX) in FH_ErrorInfo.h |
==============================================================================
##### RobotFramework Example #####
==============================================================================
@{MessageData} = Create List ${CAN01}
&{Message} = Create Dictionary DeviceAddress=${DeviceAddress_01} Function=${Function_CAN} Command=${CAN_Commands_ResetRB} Data=@{MessageData}
${Result} SendMessage &{Message}
Log Many Result = ${Result}
@{ResultComponents}= split string ${Result} |
Log Many DeviceAddress = ${ResultComponents}[0]
Log Many Function = ${ResultComponents}[1]
Log Many Command = ${ResultComponents}[2]
Log Many ErrorInformation = ${ResultComponents}[3]
Should Be Equal ${ResultComponents}[0] 01
Should Be Equal ${ResultComponents}[1] CAN
Should Be Equal ${ResultComponents}[2] ResetRB
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo}
Comments:
CAN01 => It indicates the CAN 01
DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
Function_CAN => It is the function in the message frame
CAN_Commands_ResetRB => It is the command of the function in the message frame
Result Example:
Log Many Result = ${Result} => 01|CAN|ResetRB|00|
@{ResultComponents}= split string ${Result} | => Split the result elements string by |
Log Many DeviceAddress = ${ResultComponents}[0] => DeviceAddress = 01
Log Many Function = ${ResultComponents}[1] => Function = CAN
Log Many Command = ${ResultComponents}[2] => Command = ResetRB
Log Many ErrorInformation = ${ResultComponents}[3] => ErrorInformation = 00 (ERROR_NoInfo)
Should Be Equal ${ResultComponents}[0] 01 => If ${ResultComponents}[0] (DeviceAddress) is not equal to "01" then the test is not passed
Should Be Equal ${ResultComponents}[1] CAN => If ${ResultComponents}[1] (Function) is not equal to "CAN" then the test is not passed
Should Be Equal ${ResultComponents}[2] ResetRB => If ${ResultComponents}[2] (Command) is not equal to "ResetRB" then the test is not passed
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo} => If ${ResultComponents}[3] (ErrorInformation) is not equal to "${ERROR_NoInfo} (00)" then the test is not passed
This function sets the shared data buffer (8 bit buffer) of the CAN
This command may invoke FH_CAN_SSD8_CAN01 to FH_CAN_SSD8_CAN08
| Send Message Body | Description |
|---|---|
| DeviceAddress | It shall be equal to the address of the device (FH_RFCommunication_DeviceAddress) |
| Function | Function_CAN (0x06) |
| Command | FH_CAN_Commands_SSD8 (0x05) |
| MessageDataLength | N bytes (Example: N = 5 => 0x05) |
| MessageData1 | CAN Number (0x01 for CAN01 to 0x08 for CAN08) |
| MessageData2 | Length of the data to be set |
| MessageData3 | Data1 to be set |
| MessageData... | Data... to be set |
| MessageDataN | DataN to be set |
| Checksum | Sum of all the bytes (For user-friendly design purposes, not implemented => always 0xAA) |
| Result Message Body | Description |
|---|---|
| DeviceAddress (2 bytes) | Ascii equivalent of the hex address of the device (FH_RFCommunication_DeviceAddress) |
| Function (4 bytes) | "CAN" |
| Command (4 bytes) | "SSD8" |
| MessageData (2 bytes) | Ascii equivalent of the hex value of the Error Code (XX) in FH_ErrorInfo.h |
==============================================================================
##### RobotFramework Example #####
==============================================================================
@{MessageData} = Create List ${CAN01} 04 AA BB CC DD
&{Message} = Create Dictionary DeviceAddress=${DeviceAddress_01} Function=${Function_CAN} Command=${CAN_Commands_SSD8} Data=@{MessageData}
${Result} SendMessage &{Message}
Log Many Result = ${Result}
@{ResultComponents}= split string ${Result} |
Log Many DeviceAddress = ${ResultComponents}[0]
Log Many Function = ${ResultComponents}[1]
Log Many Command = ${ResultComponents}[2]
Log Many ErrorInformation = ${ResultComponents}[3]
Should Be Equal ${ResultComponents}[0] 01
Should Be Equal ${ResultComponents}[1] CAN
Should Be Equal ${ResultComponents}[2] SSD8
Should Be Equal ${ResultComponents}[3] ${ERROR_Ok}
Comments:
CAN01 => It indicates the CAN 01
04 => Example interested length of the 8 bit data to be set
AA BB CC DD => Example data (0xAA, 0xBB, 0xCC, 0xDD) to be set in <b>FH_CAN01_SharedDataBuf_8Bits</b>
DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
Function_CAN => It is the function in the message frame
CAN_Commands_SSD8 => It is the command of the function in the message frame
Result Example:
Log Many Result = ${Result} => 01|CAN|SSD8|01|
@{ResultComponents}= split string ${Result} | => Split the result elements string by |
Log Many DeviceAddress = ${ResultComponents}[0] => DeviceAddress = 01
Log Many Function = ${ResultComponents}[1] => Function = CAN
Log Many Command = ${ResultComponents}[2] => Command = SSD8
Log Many ErrorInformation = ${ResultComponents}[3] => ErrorInformation = 00 (ERROR_NoInfo)
Should Be Equal ${ResultComponents}[0] 01 => If ${ResultComponents}[0] (DeviceAddress) is not equal to "01" then the test is not passed
Should Be Equal ${ResultComponents}[1] CAN => If ${ResultComponents}[1] (Function) is not equal to "CAN" then the test is not passed
Should Be Equal ${ResultComponents}[2] SSD8 => If ${ResultComponents}[2] (Command) is not equal to "SSD8" then the test is not passed
Should Be Equal ${ResultComponents}[3] ${ERROR_Ok} => If ${ResultComponents}[3] (ErrorInformation) is not equal to "${ERROR_Ok} (01)" then the test is not passed
This function sets the shared data buffer (16 bit buffer) of the CAN
This command may invoke FH_CAN_SSD16_CAN01 to FH_CAN_SSD16_CAN08
| Send Message Body | Description |
|---|---|
| DeviceAddress | It shall be equal to the address of the device (FH_RFCommunication_DeviceAddress) |
| Function | Function_CAN (0x06) |
| Command | FH_CAN_Commands_SSD16 (0x06) |
| MessageDataLength | N bytes (Example: N = 5 => 0x05) |
| MessageData1 | CAN Number (0x01 for CAN01 to 0x08 for CAN08) |
| MessageData2 | Length of the data to be set |
| MessageData3 | Data1 byte1 (high byte) to be set |
| MessageData4 | Data1 byte2 (low byte)to be set |
| MessageData5 | Data2 byte1 (high byte) to be set |
| MessageData6 | Data2 byte2 (low byte)to be set |
| MessageData... | Data... byte1 (high byte) to be set |
| MessageData... | Data... byte2 (low byte) to be set |
| MessageDataN-1 | DataN byte1 (high byte) to be set |
| MessageDataN | DataN byte2 (low byte) to be set |
| Checksum | Sum of all the bytes (For user-friendly design purposes, not implemented => always 0xAA) |
| Result Message Body | Description |
|---|---|
| DeviceAddress (2 bytes) | Ascii equivalent of the hex address of the device (FH_RFCommunication_DeviceAddress) |
| Function (4 bytes) | "CAN" |
| Command (4 bytes) | "SSD16" |
| MessageData (2 bytes) | Ascii equivalent of the hex value of the Error Code (XX) in FH_ErrorInfo.h |
==============================================================================
##### RobotFramework Example #####
==============================================================================
@{MessageData} = Create List ${CAN01} 02 AA BB CC DD
&{Message} = Create Dictionary DeviceAddress=${DeviceAddress_01} Function=${Function_CAN} Command=${CAN_Commands_SSD16} Data=@{MessageData}
${Result} SendMessage &{Message}
Log Many Result = ${Result}
@{ResultComponents}= split string ${Result} |
Log Many DeviceAddress = ${ResultComponents}[0]
Log Many Function = ${ResultComponents}[1]
Log Many Command = ${ResultComponents}[2]
Log Many ErrorInformation = ${ResultComponents}[3]
Should Be Equal ${ResultComponents}[0] 01
Should Be Equal ${ResultComponents}[1] CAN
Should Be Equal ${ResultComponents}[2] SSD16
Should Be Equal ${ResultComponents}[3] ${ERROR_Ok}
Comments:
CAN01 => It indicates the CAN 01
02 => Example interested length of the 16 bit data to be set
AA BB CC DD => Example data (0xAABB and 0xCCDD) to be set in <b>FH_CAN01_SharedDataBuf_16Bits</b>
DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
Function_CAN => It is the function in the message frame
CAN_Commands_SSD16 => It is the command of the function in the message frame
Result Example:
Log Many Result = ${Result} => 01|CAN|SSD16|01|
@{ResultComponents}= split string ${Result} | => Split the result elements string by |
Log Many DeviceAddress = ${ResultComponents}[0] => DeviceAddress = 01
Log Many Function = ${ResultComponents}[1] => Function = CAN
Log Many Command = ${ResultComponents}[2] => Command = SSD16
Log Many ErrorInformation = ${ResultComponents}[3] => ErrorInformation = 00 (ERROR_NoInfo)
Should Be Equal ${ResultComponents}[0] 01 => If ${ResultComponents}[0] (DeviceAddress) is not equal to "01" then the test is not passed
Should Be Equal ${ResultComponents}[1] CAN => If ${ResultComponents}[1] (Function) is not equal to "CAN" then the test is not passed
Should Be Equal ${ResultComponents}[2] SSD16 => If ${ResultComponents}[2] (Command) is not equal to "SSD16" then the test is not passed
Should Be Equal ${ResultComponents}[3] ${ERROR_Ok} => If ${ResultComponents}[3] (ErrorInformation) is not equal to "${ERROR_Ok} (01)" then the test is not passed
This function sets the shared data buffer (32 bit buffer) of the CAN
This command may invoke FH_CAN_SSD32_CAN01 to FH_CAN_SSD32_CAN08
| Send Message Body | Description |
|---|---|
| DeviceAddress | It shall be equal to the address of the device (FH_RFCommunication_DeviceAddress) |
| Function | Function_CAN (0x06) |
| Command | FH_CAN_Commands_SSD32 (0x07) |
| MessageDataLength | N bytes (Example: N = 5 => 0x05) |
| MessageData1 | CAN Number (0x01 for CAN01 to 0x08 for CAN08) |
| MessageData2 | Length of the data to be set |
| MessageData3 | Data1 byte1 (4th byte) to be set |
| MessageData4 | Data1 byte2 (3rd byte)to be set |
| MessageData5 | Data1 byte3 (2nd byte) to be set |
| MessageData6 | Data1 byte4 (1st byte)to be set |
| MessageData3 | Data2 byte1 (4th byte) to be set |
| MessageData4 | Data2 byte2 (3rd byte)to be set |
| MessageData5 | Data2 byte3 (2nd byte) to be set |
| MessageData6 | Data2 byte4 (1st byte)to be set |
| MessageData... | Data... byte1 (4th byte) to be set |
| MessageData... | Data... byte2 (3rd byte) to be set |
| MessageData... | Data... byte3 (2nd byte) to be set |
| MessageData... | Data... byte4 (1st byte) to be set |
| MessageDataN-3 | DataN byte1 (4th byte) to be set |
| MessageDataN-2 | DataN byte2 (3rd byte) to be set |
| MessageDataN-1 | DataN byte3 (2nd byte) to be set |
| MessageDataN | DataN byte4 (1st byte) to be set |
| Checksum | Sum of all the bytes (For user-friendly design purposes, not implemented => always 0xAA) |
| Result Message Body | Description |
|---|---|
| DeviceAddress (2 bytes) | Ascii equivalent of the hex address of the device (FH_RFCommunication_DeviceAddress) |
| Function (4 bytes) | "CAN" |
| Command (4 bytes) | "SSD32" |
| MessageData (2 bytes) | Ascii equivalent of the hex value of the Error Code (XX) in FH_ErrorInfo.h |
==============================================================================
##### RobotFramework Example #####
==============================================================================
@{MessageData} = Create List ${CAN01} 02 AA BB CC DD 01 02 03 04
&{Message} = Create Dictionary DeviceAddress=${DeviceAddress_01} Function=${Function_CAN} Command=${CAN_Commands_SSD32} Data=@{MessageData}
${Result} SendMessage &{Message}
Log Many Result = ${Result}
@{ResultComponents}= split string ${Result} |
Log Many DeviceAddress = ${ResultComponents}[0]
Log Many Function = ${ResultComponents}[1]
Log Many Command = ${ResultComponents}[2]
Log Many ErrorInformation = ${ResultComponents}[3]
Should Be Equal ${ResultComponents}[0] 01
Should Be Equal ${ResultComponents}[1] CAN
Should Be Equal ${ResultComponents}[2] SSD32
Should Be Equal ${ResultComponents}[3] ${ERROR_Ok}
Comments:
CAN01 => It indicates the CAN 01
02 => Example interested length of the 32 bit data to be set
AA BB CC DD 01 02 03 04 => Example data (0xAABBCCDD and 0x01020304) to be set in <b>FH_CAN01_SharedDataBuf_32Bits</b>
DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
Function_CAN => It is the function in the message frame
CAN_Commands_SSD32 => It is the command of the function in the message frame
Result Example:
Log Many Result = ${Result} => 01|CAN|SSD32|01|
@{ResultComponents}= split string ${Result} | => Split the result elements string by |
Log Many DeviceAddress = ${ResultComponents}[0] => DeviceAddress = 01
Log Many Function = ${ResultComponents}[1] => Function = CAN
Log Many Command = ${ResultComponents}[2] => Command = SSD32
Log Many ErrorInformation = ${ResultComponents}[3] => ErrorInformation = 00 (ERROR_NoInfo)
Should Be Equal ${ResultComponents}[0] 01 => If ${ResultComponents}[0] (DeviceAddress) is not equal to "01" then the test is not passed
Should Be Equal ${ResultComponents}[1] CAN => If ${ResultComponents}[1] (Function) is not equal to "CAN" then the test is not passed
Should Be Equal ${ResultComponents}[2] SSD32 => If ${ResultComponents}[2] (Command) is not equal to "SSD32" then the test is not passed
Should Be Equal ${ResultComponents}[3] ${ERROR_Ok} => If ${ResultComponents}[3] (ErrorInformation) is not equal to "${ERROR_Ok} (01)" then the test is not passed
This function gets the shared data buffer (8 bit buffer) of the CAN
This command may invoke FH_CAN_GSD8_CAN01 to FH_CAN_GSD8_CAN08
| Send Message Body | Description |
|---|---|
| DeviceAddress | It shall be equal to the address of the device (FH_RFCommunication_DeviceAddress) |
| Function | Function_CAN (0x06) |
| Command | FH_CAN_Commands_GSD8 (0x08) |
| MessageDataLength | 1 byte (0x01) |
| MessageData | CAN Input Number (0x01 for CAN01 to 0x08 for CAN08) |
| Checksum | Sum of all the bytes (For user-friendly design purposes, not implemented => always 0xAA) |
| Result Message Body | Description |
|---|---|
| DeviceAddress (2 bytes) | Ascii equivalent of the hex address of the device (FH_RFCommunication_DeviceAddress) |
| Function (4 bytes) | "CAN" |
| Command (7 bytes) | "GSD8" |
| MessageData1 (2 bytes) | Ascii equivalent of the hex value of the Error Code (XX) in FH_ErrorInfo.h |
| MessageData2 (2 bytes) | Ascii equivalent of the hex value of the CAN shared data buffer index value (Length of the shared data buffer) |
| MessageData3 (2 bytes) | Ascii equivalent of the hex value of the CAN shared data buffer value Data1 |
| MessageData... (2 bytes) | Ascii equivalent of the hex value of the CAN shared data buffer value Data ... |
| MessageDataN (2 bytes) | Ascii equivalent of the hex value of the CAN shared data buffer value DataN |
==============================================================================
##### RobotFramework Example #####
==============================================================================
@{MessageData} = Create List ${CAN01}
&{Message} = Create Dictionary DeviceAddress=${DeviceAddress_01} Function=${Function_CAN} Command=${CAN_Commands_GSD8} Data=@{MessageData}
${Result} SendMessage &{Message}
Log Many Result = ${Result}
@{ResultComponents}= split string ${Result} |
Log Many DeviceAddress = ${ResultComponents}[0]
Log Many Function = ${ResultComponents}[1]
Log Many Command = ${ResultComponents}[2]
Log Many ErrorInformation = ${ResultComponents}[3]
Log Many DataLength = ${ResultComponents}[4]
Log Many Data = ${ResultComponents}[5]
Should Be Equal ${ResultComponents}[0] 01
Should Be Equal ${ResultComponents}[1] CAN
Should Be Equal ${ResultComponents}[2] GSD8
Should Be Equal ${ResultComponents}[3] ${ERROR_Ok}
Should Be Equal ${ResultComponents}[4] 10
Should Be Equal ${ResultComponents}[5] aabbccdd000000000000000000000000
Comments:
CAN01 => It indicates the CAN 01
DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
Function_CAN => It is the function in the message frame
CAN_Commands_GSD8 => It is the command of the function in the message frame
Result Example:
Log Many Result = ${Result} => 01|CAN|GSD8|01|10|aabbccdd000000000000000000000000
@{ResultComponents}= split string ${Result} | => Split the result elements string by |
Log Many DeviceAddress = ${ResultComponents}[0] => DeviceAddress = 01
Log Many Function = ${ResultComponents}[1] => Function = CAN
Log Many Command = ${ResultComponents}[2] => Command = GSD8
Log Many ErrorInformation = ${ResultComponents}[3] => ErrorInformation = 00 (ERROR_NoInfo)
Should Be Equal ${ResultComponents}[0] 01 => If ${ResultComponents}[0] (DeviceAddress) is not equal to "01" then the test is not passed
Should Be Equal ${ResultComponents}[1] CAN => If ${ResultComponents}[1] (Function) is not equal to "CAN" then the test is not passed
Should Be Equal ${ResultComponents}[2] GSD8 => If ${ResultComponents}[2] (Command) is not equal to "GSD8" then the test is not passed
Should Be Equal ${ResultComponents}[3] ${ERROR_Ok} => If ${ResultComponents}[3] (ErrorInformation) is not equal to "${ERROR_Ok} (01)" then the test is not passed
Should Be Equal ${ResultComponents}[4] 10 => If ${ResultComponents}[4] (Shared data length) is not equal to "10" then the test is not passed
Should Be Equal ${ResultComponents}[5] aabbccdd000000000000000000000000 => If ${ResultComponents}[5] (Shared data) is not equal to "aabbccdd000000000000000000000000" then the test is not passed
This function gets the shared data buffer (16 bit buffer) of the CAN
This command may invoke FH_CAN_GSD16_CAN01 to FH_CAN_GSD16_CAN08
| Send Message Body | Description |
|---|---|
| DeviceAddress | It shall be equal to the address of the device (FH_RFCommunication_DeviceAddress) |
| Function | Function_CAN (0x06) |
| Command | FH_CAN_Commands_GSD16 (0x09) |
| MessageDataLength | 1 byte (0x01) |
| MessageData | CAN Input Number (0x01 for CAN01 to 0x08 for CAN08) |
| Checksum | Sum of all the bytes (For user-friendly design purposes, not implemented => always 0xAA) |
| Result Message Body | Description |
|---|---|
| DeviceAddress (2 bytes) | Ascii equivalent of the hex address of the device (FH_RFCommunication_DeviceAddress) |
| Function (4 bytes) | "CAN" |
| Command (7 bytes) | "GSD16" |
| MessageData1 (2 bytes) | Ascii equivalent of the hex value of the Error Code (XX) in FH_ErrorInfo.h |
| MessageData2 (2 bytes) | Ascii equivalent of the hex value of the CAN shared data buffer index value (Length of the shared data buffer) |
| MessageData3 (2 bytes) | Ascii equivalent of the hex value of the CAN shared data buffer value Data1 byte 1 (high byte) |
| MessageData4 (2 bytes) | Ascii equivalent of the hex value of the CAN shared data buffer value Data2 byte 2 (low byte) |
| MessageData... (2 bytes) | Ascii equivalent of the hex value of the CAN shared data buffer value Data... byte 1 (high byte) |
| MessageData... (2 bytes) | Ascii equivalent of the hex value of the CAN shared data buffer value Data... byte 2 (low byte) |
| MessageDataN-1 (2 bytes) | Ascii equivalent of the hex value of the CAN shared data buffer value DataN-1 byte 1 (high byte) |
| MessageDataN (2 bytes) | Ascii equivalent of the hex value of the CAN shared data buffer value DataN byte 2 (low byte) |
==============================================================================
##### RobotFramework Example #####
==============================================================================
@{MessageData} = Create List ${CAN01}
&{Message} = Create Dictionary DeviceAddress=${DeviceAddress_01} Function=${Function_CAN} Command=${CAN_Commands_GSD16} Data=@{MessageData}
${Result} SendMessage &{Message}
Log Many Result = ${Result}
@{ResultComponents}= split string ${Result} |
Log Many DeviceAddress = ${ResultComponents}[0]
Log Many Function = ${ResultComponents}[1]
Log Many Command = ${ResultComponents}[2]
Log Many ErrorInformation = ${ResultComponents}[3]
Log Many DataLength = ${ResultComponents}[4]
Log Many Data = ${ResultComponents}[5]
Should Be Equal ${ResultComponents}[0] 01
Should Be Equal ${ResultComponents}[1] CAN
Should Be Equal ${ResultComponents}[2] GSD16
Should Be Equal ${ResultComponents}[3] ${ERROR_Ok}
Should Be Equal ${ResultComponents}[4] 10
Should Be Equal ${ResultComponents}[5] aabbccdd000000000000000000000000
Comments:
CAN01 => It indicates the CAN 01
DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
Function_CAN => It is the function in the message frame
CAN_Commands_GSD16 => It is the command of the function in the message frame
Result Example:
Log Many Result = ${Result} => 01|CAN|GSD16|01|10|aabbccdd000000000000000000000000
@{ResultComponents}= split string ${Result} | => Split the result elements string by |
Log Many DeviceAddress = ${ResultComponents}[0] => DeviceAddress = 01
Log Many Function = ${ResultComponents}[1] => Function = CAN
Log Many Command = ${ResultComponents}[2] => Command = GSD16
Log Many ErrorInformation = ${ResultComponents}[3] => ErrorInformation = 00 (ERROR_NoInfo)
Should Be Equal ${ResultComponents}[0] 01 => If ${ResultComponents}[0] (DeviceAddress) is not equal to "01" then the test is not passed
Should Be Equal ${ResultComponents}[1] CAN => If ${ResultComponents}[1] (Function) is not equal to "CAN" then the test is not passed
Should Be Equal ${ResultComponents}[2] GSD16 => If ${ResultComponents}[2] (Command) is not equal to "GSD16" then the test is not passed
Should Be Equal ${ResultComponents}[3] ${ERROR_Ok} => If ${ResultComponents}[3] (ErrorInformation) is not equal to "${ERROR_Ok} (01)" then the test is not passed
Should Be Equal ${ResultComponents}[4] 10 => If ${ResultComponents}[4] (Shared data length) is not equal to "10" then the test is not passed
Should Be Equal ${ResultComponents}[5] aabbccdd000000000000000000000000 => If ${ResultComponents}[5] (Shared data) is not equal to "aabbccdd000000000000000000000000" then the test is not passed
This function gets the shared data buffer (32 bit buffer) of the CAN
This command may invoke FH_CAN_GSD32_CAN01 to FH_CAN_GSD32_CAN08
| Send Message Body | Description |
|---|---|
| DeviceAddress | It shall be equal to the address of the device (FH_RFCommunication_DeviceAddress) |
| Function | Function_CAN (0x06) |
| Command | FH_CAN_Commands_GSD32 (0x0A) |
| MessageDataLength | 1 byte (0x01) |
| MessageData | CAN Input Number (0x01 for CAN01 to 0x08 for CAN08) |
| Checksum | Sum of all the bytes (For user-friendly design purposes, not implemented => always 0xAA) |
| Result Message Body | Description |
|---|---|
| DeviceAddress (2 bytes) | Ascii equivalent of the hex address of the device (FH_RFCommunication_DeviceAddress) |
| Function (4 bytes) | "CAN" |
| Command (7 bytes) | "GSD32" |
| MessageData1 (2 bytes) | Ascii equivalent of the hex value of the Error Code (XX) in FH_ErrorInfo.h |
| MessageData2 (2 bytes) | Ascii equivalent of the hex value of the CAN shared data buffer index value (Length of the shared data buffer) |
| MessageData3 (2 bytes) | Ascii equivalent of the hex value of the CAN shared data buffer value Data1 byte 1 (4th byte) |
| MessageData4 (2 bytes) | Ascii equivalent of the hex value of the CAN shared data buffer value Data1 byte 2 (3rd byte) |
| MessageData5 (2 bytes) | Ascii equivalent of the hex value of the CAN shared data buffer value Data1 byte 3 (2nd byte) |
| MessageData6 (2 bytes) | Ascii equivalent of the hex value of the CAN shared data buffer value Data1 byte 4 (1st byte) |
| MessageData... (2 bytes) | Ascii equivalent of the hex value of the CAN shared data buffer value Data... byte 1 (4th byte) |
| MessageData... (2 bytes) | Ascii equivalent of the hex value of the CAN shared data buffer value Data... byte 2 (3rd byte) |
| MessageData... (2 bytes) | Ascii equivalent of the hex value of the CAN shared data buffer value Data... byte 3 (2nd byte) |
| MessageData... (2 bytes) | Ascii equivalent of the hex value of the CAN shared data buffer value Data... byte 4 (1st byte) |
| MessageDataN-3 (2 bytes) | Ascii equivalent of the hex value of the CAN shared data buffer value DataN byte 1 (4th byte) |
| MessageDataN-2 (2 bytes) | Ascii equivalent of the hex value of the CAN shared data buffer value DataN byte 2 (3rd byte) |
| MessageDataN-1 (2 bytes) | Ascii equivalent of the hex value of the CAN shared data buffer value DataN byte 3 (2nd byte) |
| MessageDataN (2 bytes) | Ascii equivalent of the hex value of the CAN shared data buffer value DataN byte 4 (1st byte) |
==============================================================================
##### RobotFramework Example #####
==============================================================================
@{MessageData} = Create List ${CAN01}
&{Message} = Create Dictionary DeviceAddress=${DeviceAddress_01} Function=${Function_CAN} Command=${CAN_Commands_GSD32} Data=@{MessageData}
${Result} SendMessage &{Message}
Log Many Result = ${Result}
@{ResultComponents}= split string ${Result} |
Log Many DeviceAddress = ${ResultComponents}[0]
Log Many Function = ${ResultComponents}[1]
Log Many Command = ${ResultComponents}[2]
Log Many ErrorInformation = ${ResultComponents}[3]
Log Many DataLength = ${ResultComponents}[4]
Log Many Data = ${ResultComponents}[5]
Should Be Equal ${ResultComponents}[0] 01
Should Be Equal ${ResultComponents}[1] CAN
Should Be Equal ${ResultComponents}[2] GSD32
Should Be Equal ${ResultComponents}[3] ${ERROR_Ok}
Should Be Equal ${ResultComponents}[4] 10
Should Be Equal ${ResultComponents}[5] aabbccdd010203040000000000000000
Comments:
CAN01 => It indicates the CAN 01
DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
Function_CAN => It is the function in the message frame
CAN_Commands_GSD32 => It is the command of the function in the message frame
Result Example:
Log Many Result = ${Result} => 01|CAN|GSD32|01|10|aabbccdd010203040000000000000000
@{ResultComponents}= split string ${Result} | => Split the result elements string by |
Log Many DeviceAddress = ${ResultComponents}[0] => DeviceAddress = 01
Log Many Function = ${ResultComponents}[1] => Function = CAN
Log Many Command = ${ResultComponents}[2] => Command = GSD32
Log Many ErrorInformation = ${ResultComponents}[3] => ErrorInformation = 00 (ERROR_NoInfo)
Should Be Equal ${ResultComponents}[0] 01 => If ${ResultComponents}[0] (DeviceAddress) is not equal to "01" then the test is not passed
Should Be Equal ${ResultComponents}[1] CAN => If ${ResultComponents}[1] (Function) is not equal to "CAN" then the test is not passed
Should Be Equal ${ResultComponents}[2] GSD32 => If ${ResultComponents}[2] (Command) is not equal to "GSD32" then the test is not passed
Should Be Equal ${ResultComponents}[3] ${ERROR_Ok} => If ${ResultComponents}[3] (ErrorInformation) is not equal to "${ERROR_Ok} (01)" then the test is not passed
Should Be Equal ${ResultComponents}[4] 10 => If ${ResultComponents}[4] (Shared data length) is not equal to "10" then the test is not passed
Should Be Equal ${ResultComponents}[5] aabbccdd010203040000000000000000 => If ${ResultComponents}[5] (Shared data) is not equal to "aabbccdd010203040000000000000000" then the test is not passed
Install RobotFramework
==========================================================================================================================
##### Example of installing RobotFramework with pip for Windows #####
==========================================================================================================================
Step 1 - Install Python
Step 2 - pip should be installed through the step 1
Step 3 - pip install robotframework
Step 4 - pip install robotframework-ride
Step 5 - pip install robotframework-seriallibrary
For more information refer to Robot Framework User Guide
1 - Simply copy and place FH_Embedded directory in your own source code of your interested microcontroller:
FH_Embedded directory includes FH_Functions, FH_Root and FH_Setup FH Embedded Software source code is independent of the microcontrollers and should be simply compiled without the need for any modification
2 - Set up a device address in FH Embedded Software source code:
Go to FH_Setup => FH_DeviceAddress => FH_DeviceAddress.h Set the mentioned FH_RFCommunication_DeviceAddress as device (card) address Or leave it intact as 0x01 if there is just one device (card) (there is no RS485 network)
3 - Set the maximum number of peripherals for your interested HIL Simulator:
Go to FH_Setup => FH_DevicePeripherals => FH_DevicePeripherals.h
4 - Set up a Communication Dedicated UART in FH Embedded Software source code:
1 - Baud rate => 115200;
2 - Data size => 8 bits;
3 - Stop bits => 1;
4 - Parity => None;
5 - Receive interrupt for every byte of data shall be enabled
6 - Go to FH_Setup => FH_RFCommunication => FH_RFCommunication.c
Insert the mentioned FH user defined code in Attention 1 + Attention 2 + Attention 3
7 - Include FH_RFCommunication_GlobalVariables.h in the receive ISR (Interrupt Service Routine) file
8 - Insert the mentioned FH user defined code in ISR (Interrupt Service Routine) to handle FH_RFCommunication_ReceiveBuf and FH_RFCommunication_ReceiveBufIndex
5 - Setup an interested Timer of your interested microcontroller:
1 - Interrupt for every 1 mili second shall be enabled 2 - Include FH_GlobalTimerCount.h in the ISR (Interrupt Service Routine) file 3 - Insert the mentioned FH user defined code in ISR (Interrupt Service Routine) to handle FH_GlobalTimeCounter
1 - Setup a digital output pin (for example DO01 (Digital Output 01)) of your interested microcontroller:
1 - Write a function to Initialize the digital output pin
2 - Write a function to Set the digital output pin to the logic 1
3 - Write a function to Reset the digital output pin to the logic 0
4 - Go to FH_Function => FH_DO => FH_DO01 => FH_DO01.c
Insert the mentioned FH user defined code in Attention 1 + Attention 2 + Attention 3 + Attention 4
2 - Connect the USB to Serial interface to the Communication Dedicated UART of your interested microcontroller :
1 - USB side to the computer 2 - TX and RX side to the microcontroller
3 - Run RIDE IDE
4 - Go to the test cases in TestCategoty1.robot
FH_RobotFramework => FH_TestSuites => TestSuite1 => TestCategoty1.robot
5 - Change the com port in ${SerialPortName} if it is not COM1 (According to your USB to Serial interface com port)
6 - Select (Tick by mouse click) DO_Init and DO_SetStatus test cases
7 - Go to Run tab
8 - Click on Start button
And then DO01 (Digital Output 01) is fully controllable from RobotFramework to be:
1 - Initialized
==============================================================================
##### RobotFramework Example #####
==============================================================================
@{MessageData} = Create List ${DO01}
&{Message} = Create Dictionary DeviceAddress=${DeviceAddress_01} Function=${Function_DO} Command=${DO_Commands_Init} Data=@{MessageData}
${Result} SendMessage &{Message}
Log Many Result = ${Result}
@{ResultComponents}= split string ${Result} |
Log Many DeviceAddress = ${ResultComponents}[0]
Log Many Function = ${ResultComponents}[1]
Log Many Command = ${ResultComponents}[2]
Log Many ErrorInformation = ${ResultComponents}[3]
Should Be Equal ${ResultComponents}[0] 01
Should Be Equal ${ResultComponents}[1] DO
Should Be Equal ${ResultComponents}[2] Init
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo}
Comments:
DO01 => It indicates the Digital Output 01
DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
Function_DO => It is the function in the message frame
DO_Commands_Init => It is the command of the function in the message frame
Result Example:
Log Many Result = ${Result} => 01|DO|Init|00|
@{ResultComponents}= split string ${Result} | => Split the result elements string by |
Log Many DeviceAddress = ${ResultComponents}[0] => DeviceAddress = 01
Log Many Function = ${ResultComponents}[1] => Function = DO
Log Many Command = ${ResultComponents}[2] => Command = Init
Log Many ErrorInformation = ${ResultComponents}[3] => ErrorInformation = 00 (ERROR_NoInfo)
Should Be Equal ${ResultComponents}[0] 01 => If ${ResultComponents}[0] (DeviceAddress) is not equal to "01" then the test is not passed
Should Be Equal ${ResultComponents}[1] DO => If ${ResultComponents}[1] (Function) is not equal to "DO" then the test is not passed
Should Be Equal ${ResultComponents}[2] Init => If ${ResultComponents}[2] (Command) is not equal to "Init" then the test is not passed
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo} => If ${ResultComponents}[3] (ErrorInformation) is not equal to "${ERROR_NoInfo} (00)" then the test is not passed
2 - Set
==============================================================================
##### RobotFramework Example #####
==============================================================================
@{MessageData} = Create List ${DO01} ${DO_Set}
&{Message} = Create Dictionary DeviceAddress=${DeviceAddress_01} Function=${Function_DO} Command=${DO_Commands_SetStatus} Data=@{MessageData}
${Result} SendMessage &{Message}
Log Many Result = ${Result}
@{ResultComponents}= split string ${Result} |
Log Many DeviceAddress = ${ResultComponents}[0]
Log Many Function = ${ResultComponents}[1]
Log Many Command = ${ResultComponents}[2]
Log Many ErrorInformation = ${ResultComponents}[3]
Should Be Equal ${ResultComponents}[0] 01
Should Be Equal ${ResultComponents}[1] DO
Should Be Equal ${ResultComponents}[2] SetStatus
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo}
Comments:
DO01 => It indicates the Digital Output 01
DO_Set => It indicates the Digital Output 01 shall be Set (DO_Reset indicates the Digital Output 01 shall be Reset)
DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
Function_DO => It is the function in the message frame
DO_Commands_SetStatus => It is the command of the function in the message frame
Result Example:
Log Many Result = ${Result} => 01|DO|SetStatus|00|
@{ResultComponents}= split string ${Result} | => Split the result elements string by |
Log Many DeviceAddress = ${ResultComponents}[0] => DeviceAddress = 01
Log Many Function = ${ResultComponents}[1] => Function = DO
Log Many Command = ${ResultComponents}[2] => Command = SetStatus
Log Many ErrorInformation = ${ResultComponents}[3] => ErrorInformation = 00 (ERROR_NoInfo)
Should Be Equal ${ResultComponents}[0] 01 => If ${ResultComponents}[0] (DeviceAddress) is not equal to "01" then the test is not passed
Should Be Equal ${ResultComponents}[1] DO => If ${ResultComponents}[1] (Function) is not equal to "DO" then the test is not passed
Should Be Equal ${ResultComponents}[2] SetStatus => If ${ResultComponents}[2] (Command) is not equal to "SetStatus" then the test is not passed
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo} => If ${ResultComponents}[3] (ErrorInformation) is not equal to "${ERROR_NoInfo} (00)" then the test is not passed
Then you could add another test case to Reset the DO01 (Digital Output 01) too:
==============================================================================
##### RobotFramework Example #####
==============================================================================
@{MessageData} = Create List ${DO01} ${DO_Reset}
&{Message} = Create Dictionary DeviceAddress=${DeviceAddress_01} Function=${Function_DO} Command=${DO_Commands_SetStatus} Data=@{MessageData}
${Result} SendMessage &{Message}
Log Many Result = ${Result}
@{ResultComponents}= split string ${Result} |
Log Many DeviceAddress = ${ResultComponents}[0]
Log Many Function = ${ResultComponents}[1]
Log Many Command = ${ResultComponents}[2]
Log Many ErrorInformation = ${ResultComponents}[3]
Should Be Equal ${ResultComponents}[0] 01
Should Be Equal ${ResultComponents}[1] DO
Should Be Equal ${ResultComponents}[2] SetStatus
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo}
Comments:
DO01 => It indicates the Digital Output 01
DO_Reset => It indicates the Digital Output 01 shall be Reset (DO_Set indicates the Digital Output 01 shall be Set)
DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
Function_DO => It is the function in the message frame
DO_Commands_SetStatus => It is the command of the function in the message frame
Result Example:
Log Many Result = ${Result} => 01|DO|SetStatus|00|
@{ResultComponents}= split string ${Result} | => Split the result elements string by |
Log Many DeviceAddress = ${ResultComponents}[0] => DeviceAddress = 01
Log Many Function = ${ResultComponents}[1] => Function = DO
Log Many Command = ${ResultComponents}[2] => Command = SetStatus
Log Many ErrorInformation = ${ResultComponents}[3] => ErrorInformation = 00 (ERROR_NoInfo)
Should Be Equal ${ResultComponents}[0] 01 => If ${ResultComponents}[0] (DeviceAddress) is not equal to "01" then the test is not passed
Should Be Equal ${ResultComponents}[1] DO => If ${ResultComponents}[1] (Function) is not equal to "DO" then the test is not passed
Should Be Equal ${ResultComponents}[2] SetStatus => If ${ResultComponents}[2] (Command) is not equal to "SetStatus" then the test is not passed
Should Be Equal ${ResultComponents}[3] ${ERROR_NoInfo} => If ${ResultComponents}[3] (ErrorInformation) is not equal to "${ERROR_NoInfo} (00)" then the test is not passed
For a detailed view of the project structure and to browse the source code directly within this documentation, please visit the file list page:
Contributions are welcome!