Reading value from math object

  • Software
  • Reading value from math object
VU MANH KHOI

Posted on 27.11.2023 07:38

Hello

i'm trying to read value from mathobject, but can't find a method that can read it.

I tried reading value from channel connection using getdatavalue() method but the result is null.

I use c# language with dewesoft references and dewesoft X software.

So is there any method that can read the value? Thanks a lot.

Gregor Šmit

Posted on 28.11.2023 09:09

Dear,


thank you for reaching out to us. Reading a math channel is the same as reading any other channel. In the DCOM Manual (Example: read the newest data page 51). Please also refer to our solution Reading live channel data using DCOM and Python.


Kind regards.

VM KHOI

Posted on 28.11.2023 13:24

@Gregor Šmit

Thanks. And i have 1 problem, T wanna to change formula setting.

Ex: change formula 'AI 0' * 2 to 'AI 3' * 2;

Gregor Šmit

Posted on 28.11.2023 15:31

Dear VM KHOI,


the easiest way would be to edit the XML setup file and load it. In the attachment is an image of the xml setup file and formula.


Kind regards.


Attached files:
VM KHOI

Posted on 28.11.2023 17:07

@Gregor Šmit

could you send me other way? i can't find the formula.xml file.

i want change formula in c# .net application or python application


Gregor Šmit

Posted on 29.11.2023 09:44

Dear VM KHOI,


you need to save the Dewesoft setup file to the xml format, by default it is set to .dxs file, and then you can edit this xml setup file. It is completely up to you how you will edit the xml file.


Kind regards.

VM KHOI

Posted on 29.11.2023 12:52

Dear @Gregor Šmit

So i can't change formula when the application running

Gregor Šmit

Posted on 30.11.2023 09:10

Dear VM KHOI,


as I said the easiest way of changing a formula is to change the .xml setup file and load it before the measurement. Once you are storing the data you can not add or change formulas.


Kind regards.

VM KHOI

Posted on 04.12.2023 08:25

Dear @Gregor Šmit

Thanks for responding.

Now. I want to change amplitude, offset, ... in the function generator.

In the manual, this can be read and written.

Gregor Šmit

Posted on 04.12.2023 11:02

Dear VM KHOI,


please find the attached example. It is not possible to directly write to AO channels of function generator so I used the Control channel and control channel writer to write data from control channel into the function generator control channel. In the example I control amplitude - please write analogous code for frequency and offset.


Kind regards,


Attached files:
VM KHOI

Posted on 06.12.2023 04:51

Dear Gregor Šmit


When I change the amplitude, the amplitude gradually increases.

I need an instant increase in amplitude.

so what to do?


VM KHOI

Posted on 06.12.2023 05:06

And 1 problem.

When i export multifile (excel *.xlsx) in the my application. It have not data.

picture left: using my application

picture right: using dewesoft X.

Gregor Šmit

Posted on 07.12.2023 10:04

Dear VM KHOI,

the amplitude change rate can be defined with control channels. To enable control channels please enable the option Show control channels. For more information please refer to our function generator manual.


Regarding the multifile export I do not know how you are loading and exporting the data. For example: a multifile consisting of files Test_0001.dxd, Test_0002.dxd and Test:003.dxd can be loaded with the command LoadFile("Test_*") and then you can use the export command ExportData with the desired parameters which are described in the DCOM manual.


Kind regards.


Attached files:
VM KHOI

Posted on 08.12.2023 08:53

@Gregor Šmit

when i change only in dewesoft X.The value of the voltage also does not change immediately.

Ex: Start set 5v then set 7v. The voltage will gradually increase from 5 to 7 over about 1,850 sec.

I want to increase immediately.

Gregor Šmit

Posted on 08.12.2023 09:14

Dear VM KHOI,


In the attachment I have send a video where you will be able to see how to set the amplitude change rate.


Kind regards.


Attached files:
VM KHOI

Posted on 21.02.2024 13:03

@Gregor Šmit

Can i change formula when i stay in Ch.setup monitor and don't storing.

I don't want to use change .xml file menthod. Because when i using c# and reload about 7 times and then this will be loadsetup() function error, i can't know why.

Thanks!

Gregor Šmit

Posted on 23.02.2024 10:56

Dear VM KHOI,


I have talked with our developer if it is possible to change formula by not changing the xml and the answer was that this is not possible. Regarding the loadsetup() function error, I believe you are referencing to this post. Would you please be so kind and provide a minimal working example of your code to show us how you are loading the setup file so that we could reproduce the issue and then we might debug the issue.


Kind regards.

Login to reply to this topic. If you don't have account yet, you can signup for free account .