VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

.NET API: Adding Signals to CAN Frames (CreateSignalBasedSignal)

Hello,

 

I'm using the .NET api to create a system definition and I'm currently stuck when it comes to adding signals to CAN frames. I have created an example to demonstrate the problem:

DB = Database('nixnet_example')
Frame = SignalBasedFrame('CANCyclicFrame1', 64, DB, 'CAN_Cluster', 8, 0, False, ('CANCyclicSignal1', 'CANCyclicSignal2'))
signal = clr.Reference[SignalBasedSignal]()
print Frame.CreateSignalBasedSignal('CANCyclicSignal1', '', '', 0, signal)

 The returnvalue of CreateSignalBasedSignal is false, i.e. the signal was not added to the frame. Could somebody point out why? How can I get additonal information about this error?

 

Additonally I have a few questions:

  1. Why do I have to pass the frame ID to the SignalBasedFrame constructor when this information is already stored in the database?
  2. Why do I have to pass the payload length when this information is already stored in the database?
  3. Why do I have to pass the Frame's signal names when this information is already stored in the database?

These parameters would make sense to me if it was possible to use XNET without a database file (which I would much prefer) but here it looks like duplicating information.

 

Thanks

Krid

0 Kudos
Message 1 of 3
(4,746 Views)

Hello Krid,

 

Did you create a C# .NET wrapper for the NI-XNET driver or did you find a wrapper for the driver elsewhere? I am just curious since the NI-XNET driver comes with a LabVIEW API and a C API, but not with a native C# .NET API.

dK
0 Kudos
Message 2 of 3
(4,507 Views)

Hello Daniel,

 

I was thinking of writing a simple wrapper for the XNET C-Api so that I can create a database and add frames to it from .NET. However, I have stopped investigating in that direction after I discovered that the VeriStand .NET Api functions for adding signals to frames is broken (at least that's what it looks like from my perspective).

 

I would appreciate some feedback from NI about this matter.

 

Regards

Krid

 

0 Kudos
Message 3 of 3
(4,477 Views)