Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

Read Transmitted signal on same Interface (USB-8502)

Hi, everybody:

For a school project I have to use the NI-USB-8502, in order to send and read one data frame, all using the same interface. Right now, we are trying to create 2 different sessions of J1939, one to send the frame and one to read the frame. We can sniff other signals, however we can't read the sent frame. We are developing this application on Visual C, and the APIs don't send a fail status whenever we try to read or write.

I would appreciate any help or advice that you could bring me.

Greetings

Martin

0 Kudos
Message 1 of 4
(2,778 Views)

Can you provide a little more detail in your description? 

For example, are you transmitting this sending the frame from port 1 to port 2? Are you running both input and output sessions on the same interface (port)?

Screenshots, attachments, or preferably code snippets will go a long way to getting you an accurate answer quickly.

 

Also, since it is J1939 the node address and PGN values matter. Are you claiming a node address? Is the message in question destination specific or global? Is the message targeted at a different node than the address you claim?

 

Finally, by default input sessions won't read the values being output on the same interface. You can use the Interface:Echo Transmit property to have transmitted data copied over into an input stream.

Jeff L
National Instruments
0 Kudos
Message 2 of 4
(2,725 Views)

 

Hi,

in my application we are using the only port of the USB 8502 this port is writing and must read the same message that was transmitted, we are basing the development on the examples of J1939 Input and Output Queued. Of course we are doing the claiming address and there is no error shown on the status when the claim address is made. 

We are using a broadcast type PGN, so I have no doubt that the message is transmitted, in fact if we another CAN-USB Interface we can see the message that was transmitted.

And yes, we found this property on the manual; however, we can't set it up, the thing here is that we are using a J1939 database ...


@JefeL

Finally, by default input sessions won't read the values being output on the same interface. You can use the Interface:Echo Transmit property to have transmitted data copied over into an input stream.


In the code, we tried to make the following instruction:

u8 value = 1;
u32 propertySize;
l_Status = nxGetPropertySize(*m_SessionRef, nxPropSession_IntfEchoTx, &propertySize);
l_Status = nxSetProperty(*m_SessionRef, nxPropSession_IntfEchoTx, propertySize, &value);
if (nxSuccess != l_Status)
{
DisplayErrorAndExit(l_Status, "nxSetProperty", *m_SessionRef);
}

The error that was marked was the: nxErrPropertyModeConflicting (0x029)

However, we are still getting an error whenever we execute the instruction.

Thank you for your help.

Martin

0 Kudos
Message 3 of 4
(2,719 Views)

If the Session:Application Protocol property is set to J1939 for the session, which it is by default with a J1939 database, the Interface: Echo Transmit property cannot be set to true for that session. Instead you must create a separate Frame Stream Input session on the same interface that has the application protocol property set to false and then set the echo transmit property to true on that session.

 

The reasoning behind this is that the concept of a frame in J1939 can be a bit murky. What does it mean to echo a J1939 frame? Do you only display the frame contents, or do you include transport protocol frames? Since the echo transmit property is an interface property it will be shared by all other sessions on the interface. The frame stream input sessions provides you will all frames transmitted and allows you to decide what is important and what is not. 

Jeff L
National Instruments
0 Kudos
Message 4 of 4
(2,714 Views)