Discussion:
How can I make one message using channel API?
(too old to reply)
AUTONET
2007-10-13 11:40:06 UTC
Permalink
Hi
 
I have a problem about making message using channel API.
 
First of all, I don't know how to make frame data using channel API of Visual Basic 6.0.
 
examples of NI-CAN are only single simple output. But it isn't useful to me.
 
I will explain my situation above this.
 
1. frame to send another eqiupment.
 
Data type  7  6  5  4  3  2  1  0
 
DATA1      1  0  1  0  0  0  0  0 
DATA2      06H
DATA3      00H
DATA4      00H
DATA5      00H
DATA6      00H
DATA7      00H
DATA8      00H
 
2. channel list of MAX
 
- plz refering jpg files
 

Data type  7  6  5  4  3  2  1  0
 
DATA1      t8  t7  t6  t5  t4  t3  t2  t1 
DATA2      massage(7-0)
DATA3      I did not assign channel
DATA4      I did not assign channel
DATA5      I did not assign channel
DATA6      I did not assign channel
DATA7      I did not assign channel
DATA8      I did not assign channel
 
3. source file of Visual Basic6.0 for me to make
this source refered example of NI-CAN.
 
ChannelList = "t8,t6,message"
Interface = "0"  //this means CAN0
Mode = nctModeOutput
SampleRate = CBbl(0)
 
Status = nctInitStart(ChannelList, Interface, Mode, SampleRate, TaskRef)
 
SampleArray(3) As Double
 
SampleArray(0) = CBbl(0)
SampelArray(1) = CBbl(1)
SampelArray(2) = CBbl(6)
 
Status = nctWrite(TaskRef, 1, SampleArray(0))
 
4. Questions.
 
I have programs making another person in our company. These programs send only single message.
 
NI-CAN and others equipment work well sending single message.
 
My question is I don't know whether equipment have a problem or my source is wrong.
 
Please give me sample sources of sending frame data using channel API of Visual Basic 6.0
 
Thanks.


c_max.JPG:
Loading Image...
DirkW
2007-10-16 20:40:07 UTC
Permalink
It seems you are trying to send a 8 byte CAN Frame using the Channel API. Use the Frame API instead. Or if you have to use channels and you need to write multiple values per channel, have a look to the Waveform Output example shipping with the driver.
DirkW

Loading...