Hello,
I work with a XMC45 and I communicate with my PC by modbus. For that I create 2 structures :
typedef struct
{
uint32_t STATUS;
...
} Data_Modbus_Input_Register;
typedef struct
{
uint32_t HibernateCmdStatus;
chr8_t *strMsg;
...
} Data_Modbus_Holding_Register;
After I create pointer of these structures :
Input_Register = (Data_Modbus_Input_Register*)®_input_buffer;
Holding_Register = (Data_Modbus_Holding_Register*)®_holding_buffer;
At this moment all work, I can write/read with modbus.
My problem is : I would like to read a string, so i create a pointer of a tab in one of the structure "chr8_t *strMsg"
and I would like to affect it value like : "hello you"
So i write : Holding_Register->strMsg = "hello you"
But I receive "uoy".
I think it's my definition with is not good.
Someone can help me ?
Bests regards,
Pierre
I work with a XMC45 and I communicate with my PC by modbus. For that I create 2 structures :
typedef struct
{
uint32_t STATUS;
...
} Data_Modbus_Input_Register;
typedef struct
{
uint32_t HibernateCmdStatus;
chr8_t *strMsg;
...
} Data_Modbus_Holding_Register;
After I create pointer of these structures :
Input_Register = (Data_Modbus_Input_Register*)®_input_buffer;
Holding_Register = (Data_Modbus_Holding_Register*)®_holding_buffer;
At this moment all work, I can write/read with modbus.
My problem is : I would like to read a string, so i create a pointer of a tab in one of the structure "chr8_t *strMsg"
and I would like to affect it value like : "hello you"
So i write : Holding_Register->strMsg = "hello you"
But I receive "uoy".
I think it's my definition with is not good.
Someone can help me ?
Bests regards,
Pierre