05-27-2016 09:21 AM
Hi, I am developing a flash tool to flash hex file for vector xl driver.I have written a
hardware configuration file for vector xl driver using interfaces provided by the vector. my configuration is fine as per example provided by the vector. but when i transmitting a data using xlLinSetSlave interface. i am always not getting a response from the hardware after sending a data.I am not understanding after sending a data using xlLinSetSlave interface , it is not always hitting to the hardware interrupt. as you can see in code that, the interface LINSendMasterReq used to send data from the application and inside interface, i am calling two interfaces xlLinSendRequest to set master request and linSetSlave to set slave for transmit and receive data.please have a look:
#include "Device.h" #include "QString" #include <qdebug> XLstatus Device::LINSendMasterReq(unsigned char *data, int linID) { XLstatus xlStatus = XL_ERROR; char tmp[100]; // send the master request xlStatus = xlLinSendRequest(m_xlPortHandle, m_xlChannelMask[MASTER], (unsigned char)linID, 0); // setup the only slave channel (LIN ID + 1) xlStatus = linSetSlave(linID+1, data); return xlStatus; } XLstatus Device::linSetSlave(int linID, unsigned char *databyte) { XLstatus xlStatus = XL_ERROR; char tmp[100]; XLevent xlEvent; unsigned char data[8]; for(int i=0;i<8;i++) { data[i] = databyte[i]; } xlStatus = xlLinSetSlave(m_xlPortHandle, m_xlChannelMask[SLAVE], (unsigned char)0x3C, data, DEFAULT_LIN_DLC, XL_LIN_CHECKSUM_CLASSIC); Sleep(timeval); xlStatus = xlLinSendRequest(m_xlPortHandle,m_xlChannelMask[MASTER],(unsigned char)0x3D,0); return xlStatus; }
Solved! Go to Solution.
07-20-2016 08:28 PM
Maybe this is the wrong forum? I can't see any LabVIEW. Is it perhaps LabWindows/CVI?