03-06-2021 12:37 PM
Hi,
I wrote a program to read the analog signal coming from my Arduino.
I used LINX Toolkit, but I am unable to set the sampling rate. I would like to customize the sampling rate depending on my need.
I saw that in the LIFA Toolkit, there is a Continuous Acquisition Sampling block that I can maybe use to set up my sampling rate.
Therefore, I changed my program replacing all the LINX blocks with Arduino LIFA Blocks. However, when I want to upload the LIFA firmware on Arduino IDE, I have some warnings and my LabVIEW code is not working.
Please see below the warnings:
C:\Program Files\National Instruments\LabVIEW 2018\vi.lib\LabVIEW Interface for Arduino\Firmware\LIFA_Base\LabVIEWInterface.ino: In function 'void processCommand(unsigned char*)':
C:\Program Files\National Instruments\LabVIEW 2018\vi.lib\LabVIEW Interface for Arduino\Firmware\LIFA_Base\LabVIEWInterface.ino:150:60: warning: left shift count >= width of type [-Wshift-count-overflow]
duration=(command[8]+ (command[7]<<8)+ (command[6]<<16)+(command[5]<<24));
^~
C:\Program Files\National Instruments\LabVIEW 2018\vi.lib\LabVIEW Interface for Arduino\Firmware\LIFA_Base\LabVIEWInterface.ino:150:77: warning: left shift count >= width of type [-Wshift-count-overflow]
duration=(command[8]+ (command[7]<<8)+ (command[6]<<16)+(command[5]<<24));
^~
C:\Program Files\National Instruments\LabVIEW 2018\vi.lib\LabVIEW Interface for Arduino\Firmware\LIFA_Base\LabVIEWInterface.ino: In function 'sevenSegment_Config(unsigned char*)':
C:\Program Files\National Instruments\LabVIEW 2018\vi.lib\LabVIEW Interface for Arduino\Firmware\LIFA_Base\LabVIEWInterface.ino:632:29: warning: iteration 7 invokes undefined behavior [-Waggressive-loop-optimizations]
sevenSegmentPins[(i-1)] = command[i];
~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
C:\Program Files\National Instruments\LabVIEW 2018\vi.lib\LabVIEW Interface for Arduino\Firmware\LIFA_Base\LabVIEWInterface.ino:629:17: note: within this loop
for(int i=2; i<10; i++)
~^~~
C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino\main.cpp: In function 'main':
C:\Program Files\National Instruments\LabVIEW 2018\vi.lib\LabVIEW Interface for Arduino\Firmware\LIFA_Base\LabVIEWInterface.ino:632:29: warning: iteration 7 invokes undefined behavior [-Waggressive-loop-optimizations]
sevenSegmentPins[(i-1)] = command[i];
^
C:\Program Files\National Instruments\LabVIEW 2018\vi.lib\LabVIEW Interface for Arduino\Firmware\LIFA_Base\LabVIEWInterface.ino:629:17: note: within this loop
for(int i=2; i<10; i++)
^
Sketch uses 18368 bytes (56%) of program storage space. Maximum is 32256 bytes.
Global variables use 1109 bytes (54%) of dynamic memory, leaving 939 bytes for local variables. Maximum is 2048 bytes.
Do you know if my LabVIEW code is not working because of those warnings or any other problem?
Thank you so much for your help!
09-03-2021 02:08 AM
Hi,
Sorry to bother.
I'm seeing a fault like yours. If you sloved that problem, could you help me.
Sorry to my English skill. I'm Vietnamese.