Hi, I have an Arduino program that I need to convert to Flowcode, but my knowledge of the Arduino platform is not good enough for this. Is there anyone out there who wants to take this job. I would be happy to pay you for this
I am trying to use this byte line in FC's C-Code box
byte id155_init[8] = { 0xFF, 0x97, 0xD0, 0x94, 0x00, 0x08, 0x00, 0x6F };
I create an id155_init variable and write the line like this in the C-Code box:
FCV_id155_init[8] = { 0xFF, 0x97, 0xD0, 0x94, 0x00, 0x08, 0x00, 0x6F };
I get this error when I compile it
OrionBMS_CAN Translator.c:5575:2: error: 'FCV_id155_init' undeclared (first use in this function)
OrionBMS_CAN Translator.c:5575:2: note: each undeclared identifier is reported only once for each function it appears in
OrionBMS_CAN Translator.c:5575:22: error: expected expression before '{' token
OrionBMS_CAN Translator.c:5605:2: warning: 'return' with a value, in function returning void
Ok so now I have created a variable id155_init[8] with data { 0xFF, 0x97, 0xD0, 0x94, 0x00, 0x08, 0x00, 0x6F }
Now if I want to retrieve/Save data 1 from/to the variable id155 (which is 0x97) How do I do that?
I have tried to retrieve it like this and put it in data 6 in this CAN message without success:
FC_CAN_SetTxIdent_1(0, 0x659);FC_CAN_SetTxData_1(0, 4, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, id155_init[1], 0x00);FC_CAN_SendBuffer_1(0);
If I do this, all the data in the CAN message is changed, not just data 6.
Ok so now I have created a variable id155_init[8] with data { 0xFF, 0x97, 0xD0, 0x94, 0x00, 0x08, 0x00, 0x6F }
Now if I want to retrieve data 1 from the variable id155 (which is 0x97) How do I do that?
I have tried to retrieve it like this and put it in data 6 in this CAN message without success:
FC_CAN_SetTxIdent_1(0, 0x659);FC_CAN_SetTxData_1(0, 4, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, id155_init[1], 0x00);FC_CAN_SendBuffer_1(0);
If I do this, all the data in the CAN message is changed, not just data 6. and none of them are 0x97
In arduino, data is retrieved like this. For an example
id155_init[0] = 0xFF
id155_init[1] = 0x97
id155_init[2] = 0xD0
id155_init[3] = 0x94
id155_init[4] = 0x00
id155_init[5] = 0x08
id155_init[6] = 0x00
id155_init[7] = 0x6F
I found that the correct thing in FC is:
FCV_id155_init[0] = 0xFF
FCV_id155_init[1] = 0x97
FCV_id155_init[2] = 0xD0
FCV_id155_init[3] = 0x94
FCV_id155_init[4] = 0x00
FCV_id155_init[5] = 0x08
FCV_id155_init[6] = 0x00
FCV_id155_init[7] = 0x6F
Last edited by kennethnilsen69 on Fri Sep 16, 2022 10:00 am, edited 1 time in total.