Jump to content
  • 0

Multiple AD2 devices in single Waveforms instance


Piotr Rzeszut

Question

Hi,

I was playing for quite a bit with single AD2 and I find it great tool. Now I have two devices and I successfully connected them using triggers to have 4 analogue channels in scope, but i have to use two scope windows, with separate timebase... I have noticed other users' therads:

It would be great if one instance of Waveforms could manage two or more AD2 devices to result in multi-channel scope/generator/etc.Of course user would have to be aware of using separate clock systems on each device, what could cause some problems in specific situations.

@attila - is something like that possible in nearby future?

Kind regards

PR

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

Hi @Piotr Rzeszut

You might try the following.
I had no time to test it with devices, but theoretically it should work if you configure proper triggering between the devices.

Slave application/device saves data to file:

image.png.5a454afbc3e3619d5a63cdd12bd8cc92.png

{
var f = File("1.bin")
f.writeDouble(Scope.Channel1.alldata)
}
{
var f = File("2.bin")
f.writeDouble(Scope.Channel2.alldata)
}

 

Master application/device loads data to ref1/2:

image.thumb.png.670168b71221615902e587daab9b9fb7.png

{
// update time information, restore offset/range
var r = Scope.Ref1.Range.value
var o = Scope.Ref1.Offset.value
Scope.Ref1.Clone(Scope.Channel1) 
Scope.Ref1.Range.value = r
Scope.Ref1.Offset.value = o
var f = File("1.bin")
// we might have to wait for the other process to save the data
for(var i = 0; i < 1000 && !f.exist(); i++);
// read data and set it to reference channel
var rg = f.readDouble()
f.deleteFile()
Scope.Ref1.data = rg
}
{
var r = Scope.Ref2.Range.value
var o = Scope.Ref2.Offset.value
Scope.Ref2.Clone(Scope.Channel2) 
Scope.Ref2.Range.value = r
Scope.Ref2.Offset.value = o
var f = File("2.bin")
for(var i = 0; i < 1000 && !f.exist(); i++);
var rg = f.readDouble()
f.deleteFile()
Scope.Ref2.data = rg
}
Link to comment
Share on other sites

@attila, thank you for the answer, you are doing amazing job ;)

The script is a kind of working, but quite often this happens:

image.thumb.png.2fd0a2746e2dfca20a5287873fbd701d.png

As you can see I tried modifying script in order to ensure that there is no attempt to access non-existing file. Also I removed creating reference channel each time - as soon as they are created only writing is required. I suppose it can be caused by reading partially completed file?

Link to comment
Share on other sites

Hi @Piotr Rzeszut

When the time base or position is changed the information in Ref channel needs to be updated. This is done by the Clone function.

// update time information, restore offset/range
var r = Scope.Ref1.Range.value
var o = Scope.Ref1.Offset.value
Scope.Ref1.Clone(Scope.Channel1) 
Scope.Ref1.Range.value = r
Scope.Ref1.Offset.value = o

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...