10-27-2017 05:14 AM
Hi,
I'm trying to find the best approach to send the cyclic message consisted of 8 signals. The message and the signals are defied in the XNET database. What I want to do is:
1. Open the session using message name
2. Write message by passing engineering values (array of DBL) to write function opened on session from point 1.
I couldn't find any examples.
To visualise my approach so far:
Engineering data to send:
Constructing the array with current time:
Approach to send:
Error:
Error -1074384753 occurred at XNET Write (Signal Single-point).vi:3310002
NI-XNET: (Hex 0xBFF6308F) The function you called is not defined for the session mode (e.g. you called a frame I/O function on a signal I/O session).
Solved! Go to Solution.
10-27-2017 08:03 AM - edited 10-27-2017 08:05 AM
First next time post VIs, or snippets, not pictures. You wouldn't post pictures of notepad in a text based language forum.
Secondly there are plenty of examples shipped with XNet drivers for how to do this. Go to Help >> Find Examples and search XNet.
Third to make your code work you need to define what signals you are going to be writing to. In the Create Session you need to provide the array of signals you want to write, and then when you write they need to write an array of the same size. Attached is an example.
In your example you used the Queued mode which isn't the one you want you likely want single point. In Part 6 of my CAN Blog I go over the advanced XNet modes and describe when you might want each mode.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
11-01-2017 04:25 AM - edited 11-01-2017 04:26 AM
@Hooovahh wrote:
First next time post VIs, or snippets, not pictures. You wouldn't post pictures of notepad in a text based language forum.
OK
Hooovahh wrote:Secondly there are plenty of examples shipped with XNet drivers for how to do this. Go to Help >> Find Examples and search XNet.
Because I couldn't find what I wanted amongst all examples that is why I posted it on the forum.
Hooovahh wrote:Third to make your code work you need to define what signals you are going to be writing to. In the Create Session you need to provide the array of signals you want to write, and then when you write they need to write an array of the same size. Attached is an example.
That's the whole point of my query. I was looking for a method of writing/sending the messages as are defined in the database, and not to arrange again their signals into the groups and write them. In my scenario I have nine messages, 1 to 9 signals each, sending cyclically at four different intervals and it would be much convenient for developers to refer the messages rather than their particular signals.
So from your post I understand this method of sending/writing is not available.
11-01-2017 07:51 AM
MimiKLM wrote:That's the whole point of my query. I was looking for a method of writing/sending the messages as are defined in the database, and not to arrange again their signals into the groups and write them. In my scenario I have nine messages, 1 to 9 signals each, sending cyclically at four different intervals and it would be much convenient for developers to refer the messages rather than their particular signals.
So from your post I understand this method of sending/writing is not available.
It is still not clear what you are trying to do. You started saying you had 8 signals to write, and they look pretty static since they are just time and date in a specific format. If this is the case why can't you specify the signal names for each value? That is why I posted the example I did and said to look into the shipped example on writing signals.
Now you are saying there is from 1 to 9 signals to write? and the user needs to have some selection on messages rather than signals? If you want to get the signals inside a frame this is possible using the XNet database API but I still don't have a clear picture of what you want or how it should work. I'm pretty sure whatever you want it to do it can do, XNet is extremely flexible.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
11-01-2017 08:49 AM - edited 11-01-2017 08:55 AM
Ok,
Maybe I used some implicit assumptions, so I explain once again.
The question I will be asked is will be: "have you send all messages" not "have you send all signals". I know that at the end of the day they mean the same but it would be much convenient to operate on messages as the objects rather than on the signals.
So I think that something like described below should exist:
1. open the session using the message name
2. pass to write vi an array (of size of the size the message array which contains all signals belonged to the message) with the engineering values of the signals.
3. loop number 2
4. close the reference and exit the program
Rather than existing
1. open the session based on an array with the signals disassembled from the already defined messages
2. pass to write vi an array consisted with these signals
3. loop number 2
4. close the reference and exit the program
PS: I've stated that I have a message (it is called timeDATE_VAR2) consisted of eight signals, just to visualize my situation. If I know how to sent one message (as per message, not per group/array freely chosen signals) then I could send rest of them
11-01-2017 09:37 AM - edited 11-01-2017 09:38 AM
Okay how about this solution. I think this demonstrates all the pieces of what you need but maybe isn't in the form you want yet. You pick the frame which selects all the signals in that frame and sets their default values. The user can then change the values, and click Start which will set those values, with those signals. I'm not sure how you would want to visualize multiple frames (tabs? subpanels? a tree control?) But it could be done.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
05-03-2018 12:16 AM
Dear Hooovahh,
Good day.
Thanks for you read my message.
I met problem of writing message in CAN communication using USB-8502 in Xnet.
When I send some data to specific signals, I always find the problem "NI-XNET: (Hex 0xBFF63091) For Signal Output sessions, the multiplexer signals used in the session must be specified explicitly in the signal list."
I am not familiar with CAN communication.
Could you help me write a problem or an example.
Which can call the xx.dbc file, reading and sending the signals based the attached file requirements.
I am very appreciated to you kindly help.
Thanks and have a good day.
Best regards,
Kai,
05-03-2018 07:35 AM
I think the error is pretty clear. It states that for the session you created, doesn't specify the multiplexer signal and is required since you selected some signals which are multiplexed. This means you need to add the PS5_Settings_Mux signal to your array of signals to write. I'm unsure if when you perform the write you now need to write 4 signals, or if the XNet API ignores that since it will be handled by the session.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
05-03-2018 07:53 AM
Dear Hooovahh,
Thanks for your reply.
According to your indication, I modify the signal lists as the posted figure.
I want to be sure whether the first signal is be sent cyclically with message repetition rate at 500ms?
Your kindly help is important to me to solve the problem I encount.
Thanks again.
Best regards,
Kai
05-03-2018 08:20 AM
Well then you are going to want to edit that database because I believe that signal is not set to be sent at that rate. Open the XNet Database Editor and look at change that frames retransmit rate. This can also be edited programatically with the database editing API. Examples can be found in Help >> Find Examples on how to do this.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord