11-15-2018 11:01 PM
Hi,
I want to use memcpy in formula nodes.
But there is error in my program.
Labview is not support memcpy?
or I mistake somethings?
Solved! Go to Solution.
11-15-2018 11:09 PM
Why do you want to use memcpy?
No, it is not a valid command for a formula node.
What are you really trying to do?
11-15-2018 11:40 PM
I want to send float data to PC using UART.
My MCU(STM32) source is below.
uint32_t ftoc_buffer2=0;
float32_t IIR_HPF_output_display;
uint8_t tx_buff[6];
memcpy(&ftoc_buffer2,&IIR_HPF_output_display,4); // for uart send
tx_buff[2]=ftoc_buffer2>>24;
tx_buff[3]=ftoc_buffer2>>16;
tx_buff[4]=ftoc_buffer2>>8;
tx_buff[5]=0xFF&ftoc_buffer2;
[send txbuff[] by uart]
I convert float data to 8bit hex data. And send to PC by UART.
And, Labview program receive 4*8bit hex data
And convert to 32bit hex data
After that, I stuck how convert to float value.
In C language, I use memcpy.
How can i convert in labview?
11-16-2018 12:40 AM - edited 11-16-2018 12:59 AM
Typecast the 4 byte string to a SGL. (virtually no code needed. Reverse the string if you need little endian byte order or use unflatten from string instead)
See attached.
(In your original code, make sure the outputs are SGL, not DBL)
11-18-2018 09:43 PM
Thank you for your help.
Work very well my program.