• 0
Sign in to follow this  
omur

AD2 waveForms script

Question

I need to send logic bus value to analog output by using Wavegen simultaneously.

Wavegen1.Channel1.Custom.data= Logic1.Channels.Bus.data 

Share this post


Link to post
Share on other sites

6 answers to this question

Recommended Posts

  • 0
Posted (edited)

Mr. Atilla, Thanks for your reply. Can you check my script. I normalized my bus. It is ok but I cannot send this data to wavegen

 

Wavegen1.Channel1.Mode.text = "Custom";

Scope1.Trigger.Trigger.text = "Repeated";

Scope1.run();

Logic1.run();

var datam = Logic1.Channels.Bus.data

var data_norm = [];

for(var idx = 0;idx < 2500; idx++){

data_norm[idx] = parseFloat(datam[idx])/4095;

}

print(data_norm)😍  

plot1.X.data = idx

plot1.Y1.data = data_norm

Wavegen1.Channel1.Custom.Type.text = data_norm😡

Wavegen1.run();

Edited by omur

Share this post


Link to post
Share on other sites
  • 0

Hi @omur

 

// start capture and wait to be finished
Logic1.single()
Logic1.wait()

// on AD by default the Logic Analyzer and Wavegen have the same 4064 buffer
var datam = Logic1.Channels.Bus.data
var data_norm = []
datam.forEach(function(v){data_norm.push(v/4095)})

plot1.Y1.data = data_norm

Wavegen1.Channel1.Mode.text = "Custom"
Wavegen1.Custom.set("mycustom", data_norm)
Wavegen1.Channel1.Custom.Type.text = "mycustom"
Wavegen1.run()

image.thumb.png.004701633194b240b87592b4150fae31.png

Share this post


Link to post
Share on other sites
  • 0

Hi @attila

I need to send bus data simultaneous and continuous to wavegen.

Is it possible?

This script does not run in a while(1) loop. 

I'm waiting for your suggestions.

 

Share this post


Link to post
Share on other sites
  • 0

Hi @omur

Such continuous digital input and analog output is not supported by the application.
It could be done with the WaveForms SDK, see the samples /py/ DigitalIn_Record.py and AnalogOut_Play.py examples.

image.png.e704231311d14d93747fc635fb5a8121.png

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this