Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

You are here: Forum Home → ANT+ Forums → ANT+ Simulation Tools → Thread

   

Multi Channel Simulation

Rank

Total Posts: 2

Joined 2016-03-01

PM

I am attempting to concept a device using SimulANT+ 1.10 that consists of using three simulators. Two acting as slaves and one master. Each pairing with different devices. Using four ANT+ USB keys this seems to work. Now I need to share and manipulate data from the three simulations with each other. Is this possible? Not being much of a code writer I might manage to muddle through a Simulant script if provide some direction.
Thanks.      
RankRankRankRank

Total Posts: 120

Joined 2013-05-07

PM

Emotion,

SimulANT+ scripts are oriented towards controlling one simulated device at a time. That being said, it is possible to script multiple devices in a single python script run through SimulANT+, as well as creating a .NET simulation application.

If you are trying to simulate multiple devices in the same program and are familiar with .NET, I would suggest writing your own .NET application (instead of using python), using the Windows Library Demo as a guide, but using profiles from ANT+Profiles.dll to specify the function of an acquired channel as shown below. Just like with python, you can write delegates for exposed events. Writing code on the native platform will give you a lot more control over your simulation, and it will be a lot easier to debug than using a python script.
The other option is to write a python script that uses ANT_NET.dll to access an ANT device, create a channel, and hook up a profile to it. To use this approach, you will require additional ANT USB sticks. Since the ironpython scripts are built on top of the .NET framework, I would again use the code in Windows Library Demo as a guide. Just remember to add the following lines to the top of your script:
clr.AddReference('ANT+ProfileLib')
clr.AddReference('ANT_NET.dll')
from ANT_Managed_Library import ANT_DeviceANT_ChannelIANT_ChannelANT_ReferenceLibrary 

One thing to note about the python script approach is that the additional devices created will not have their own simulANT+ UI, and will only work in the background.

Using either platform, after you have acquired a channel, call the constructor of the profile you would like to simulate, and then turn the sensor on:
// get ANT_Device
// channel = get ANT_Channel
HeartRateSensor sensor = new HeartRateSensor(channelnetwork);
// define delegates
// change parameters
sensor.TurnOn();
// log data
sensor.TurnOff();
// release ANT_Device 

Neither approach is trivial.      
Rank

Total Posts: 2

Joined 2016-03-01

PM

Thanks much. I am consulting with a very experienced .net programmer and will forward your response.