Hello, I am using the simulate LIN network - master transmit VI that TroyK built. I was wondering if it is possible to drive two channels of the Vector VN1640 hardware at the same time. Has anyone done this before or know if it is possible?
Solved! Go to Solution.
The LIN network master transmit VI can already do this can't it? That's why the "Responding Slaves" control is an array.
You just need to make sure you have the correct piggies loaded in the channels.
Or are you talking about having multiple simultaneous master nodes? You can do that too, you just need to code it.
Thanks for your quick response. Yes, I am talking about simultaneous master nodes on up to 4 channels. I am still quite new to LabView, but after looking at you code I would assume that by adding another channel configuration cluster element to the build array function in the Init state, that this would be the way to go. Also creating a for loop around the code in the SetMaster state and indexing to the number of masters should make it work, or I am missing something fundamental?
I would really appreciate you reply on this.
It sounds like you know what to do with the LabVIEW part, just make sure you also understand what is needed by the vxlapi part.
I'm guessing that you will only want a transmit to come out of one master. That means you have to use it's specific access mask, not a combined one.
Could you specify what you mean when you say " understand what is needed by the vxlapi part"?
No, I want the same data to come out of both masters at the same time, because I am driving 2 parts that should do the same thing.
What I am ultimately trying to do is drive two master channels with the same data. I am also trying to change the data that the masters are transmiting, dynamically. This means that I get my ID and Data from another VI while the Bus is running. So that when new data is incoming, I need to overwrite the data that is in the master transmit data array with the new data and let the bus run.
I would really appreciate if you could point me in the right direction to solve this problem, without messing with the bus to much. I've been trying to create a solution for almost a week now with no real success.
Thanks in advance!
@alexkon wrote: Could you specify what you mean when you say " understand what is needed by the vxlapi part"?
The API needs functions to be called in the right sequence with the right input parameters. The best way to know how to do it is to read and understand what this is in the "XL Driver Library - Description.pdf" document that comes when you install the library.
I found the flowcharts section most helpful to get the sequence correct and then the description of the individual functions to get the input parameters correct.
For LIN it's at API document pdf > 6 LIN Commands > 6.2 Flowchart
Here is an image of what it looks like at the moment...
Other than a good understanding of how LIN and LIN slave simulation actually work, that should be everything you need. There is a bit of a learning curve but there is no substitute for understanding it. (Unless you have a contractor write and maintain the code for you.)