The following structure is passed between LV and VC's WIN32 DLL.
typedef struct npm_axis
{
int axis_select;
int sv;//initial speed
int v;//drive speed
//int acc;//linear acceleration
//int dec;//linear deceleration
int sacc;//s-curve acceleration interval
int sdec;//s-curve deceleration interval
int tacc;//acceleration time
int tdec;//deceleration time
char line_s;//acceleration mode
int limit_speed;//speed limit
int pos;//absolute
int dis; //increment int
center;
//int speed;//start command
} uAXIS;
As a result, the data below char are all wrong. The reason is found on the Internet: LV uses a byte alignment method, that is, the cluster of LV is stored without gaps, and the size of the space occupied is the sum of the space occupied by this element. Usually, the DLL uses integer alignment (related to the compiler).
You can change char to int to deal with emergencies. It is recommended to refer to the example of CALL DLL.VI in LV.
Keywords:LabVIEW
Reference address:Structure alignment issues encountered using LabVIEW
typedef struct
{
} uAXIS;
As a result, the data below char are all wrong. The reason is found on the Internet: LV uses a byte alignment method, that is, the cluster of LV is stored without gaps, and the size of the space occupied is the sum of the space occupied by this element. Usually, the DLL uses integer alignment (related to the compiler).
You can change char to int to deal with emergencies. It is recommended to refer to the example of CALL DLL.VI in LV.
Previous article:Implementation methods of two check codes of Modbus protocol based on LabVIEW
Next article:Decoding Labview read and write binary file format
- Popular Resources
- Popular amplifiers
Recommended Content
Latest Test Measurement Articles
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Seizing the Opportunities in the Chinese Application Market: NI's Challenges and Answers
- Tektronix Launches Breakthrough Power Measurement Tools to Accelerate Innovation as Global Electrification Accelerates
- Not all oscilloscopes are created equal: Why ADCs and low noise floor matter
- Enable TekHSI high-speed interface function to accelerate the remote transmission of waveform data
- How to measure the quality of soft start thyristor
- How to use a multimeter to judge whether a soft starter is good or bad
- What are the advantages and disadvantages of non-contact temperature sensors?
- In what situations are non-contact temperature sensors widely used?
MoreSelected Circuit Diagrams
MorePopular Articles
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
MoreDaily News
- Innovation is not limited to Meizhi, Welling will appear at the 2024 China Home Appliance Technology Conference
- Innovation is not limited to Meizhi, Welling will appear at the 2024 China Home Appliance Technology Conference
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Download from the Internet--ARM Getting Started Notes
- Learn ARM development(22)
- Learn ARM development(21)
- Learn ARM development(20)
- Learn ARM development(19)
- Learn ARM development(14)
- Learn ARM development(15)
Guess you like
- Easy-to-use nine-channel RGB LED driver
- [Application development based on NUCLEO-F746ZG motor] 10. Parameter configuration - GPIO port configuration
- Connection between Bluetooth module HC-05 and 51 microcontroller
- Magnetic Hall Sensor Omnipolar MH251
- Flexible vibration plate machine operation demonstration diagram
- IO cannot be set to 0
- Tips to Avoid Detours in NIOS II SOPC Development
- A newbie wants to control a stepper motor and ask for guidance
- Summarizing the experience of the big guys, how to learn STM32? (Entry, Advanced)
- Summary of basic knowledge points of C language