Accessing Channel data using python script

  • Software
  • Accessing Channel data using python script
B N

Posted on 12.02.2023 12:51

Hi,
I have a dewesoft Sirius DAQ to which current, voltage, etc., sensors are connected to. I am currently trying to access the channel data using the DSRemote library but there seems to be an issue with the number of channels passed. If possible, can you please help me out with the following things:


  1. Python script for accessing the channel data to store as an array.
  2. Documentation for the DSRemoteConnect64.dll



  3. The data being displayed is being scaled.How to find the scaling factor?
  4. Any other way to read the data being pushed from the TCP port to readable format?


Please do the needful.


Gregor Šmit

Posted on 14.02.2023 14:37

Dear,


thank you for reaching out to us. In the DSRemoteConnect library there is a DSRemoteConnect.h file where you can see which channel properties can be read. The properties are: name, sample rate, type, unit and if a channel is a control channel or not. It is not possible to read the scaling factor. We do not have special documentation for DSRemoteConnect64.dll, but we have a PRO Training description of DSRemote library. Would you please be so kind and tell us if you have successfully run the example and please tell us more about the issue with the number of channels passed.


We also have Dewesoft NET, that can be used with Python. For the example please refer to the Python example of Dewesoft NET. With this example you can read the custom_scale and custom_offset of each channel.



Kind regards.

B N

Posted on 15.02.2023 12:25

@Gregor Šmit

Hi,


Thanks for your reply. The issue with the number of channels passed is that the code written is only for two channels, I guess, and I'm not able to access the channel data when I use a custom setup file rather than the one given in the DSRemote Library.

Also, please let me know how to store the incoming values in a .txt or .csv format at the same rate as the sampling rate ( approximately 10kHz).

B N

Posted on 15.02.2023 13:00

Hi,


Can you also let me know how to rectify this error.

Gregor Šmit

Posted on 16.02.2023 14:37

Dear,


yes the example set to use two channels. Since you are using the Python example of Dewesoft NET (according to the attached image) there are three channels that are being red (CH 0, CH 1, CH 2). The channels that are defined for reading are defined in the column 98. You need to change the command prepare_channels and the line with comment here we select which channels we want to transfer accordingly.



You can write the data to a file with the python command output_file.write("data") where you have previously opened a file output_file.


The error is due to the fact that you do not have the file dwserver.py in the directory. In the example there are two python files dwserver.py and dwclient.py. In the script dwclient.py the dwserver script is imported.


Kind regards.

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