Post Go back to editing

M2kcli multiple channels from CSV

Thread Summary

The user is unable to generate a pattern on digital channel 1 using the ADALM2000 and m2kcli interface. The solution involves ensuring the correct bit is set in the CSV file for channel 1 and enabling the channel in the m2kcli command. The sample CSV and command provided demonstrate how to enable multiple channels and output the desired pattern.
AI Generated Content
Category: Software
Product Number: ADALM2000
Software Version: libm2k v0.9.0

Hello,

I am trying to generate patterns on digital channel 1 using the ADALM2000 and the m2kcli interface.

The pattern is:

0

0

0

1

1

1

When using the command m2kcli digital auto -9 channel=0 cyclic=0 buffer_size=6 < "pathtocsv.cv", the square wave is outputted onto channel 0.

However if I change channel to channel=1, no output can be seen on channel 1.

I have also tried the following pattern in the csv with two columns and have had no success.

0 0

0 0

0 0

0 1

0 1

0 1

How is it possible to get an output from channel 1 using the CSV?

Best regards,

Liam

  • Hello,


    To answer the question: yes, it is possible to get an output for any channel using samples from a csv file.


    For this it is important to understand how the CSV and channel settings work:

    • Each sample in the CSV represents a 16-bit value in decimal format, where each bit corresponds to one of the 16 digital channels (bit 0 = channel 0, bit 1 = channel 1, ...).
    • To activate channel 1 during a sample period, you need to set the bit index 1 to the value of "1" for that sample. For example:
      • A sample value of 2 (binary: 00000010) will set only the channel 1 to high for that sample period
      • A sample value of 3 (binary: 00000011) will set both channel 0 and 1 to high for that sample period
    • The channel argument in from the m2kcli command is used to enable specific channels for output. If a channel is not enabled, it's data won't be output even if present in the CSV samples.

    To better understand how it works, I suggest creating a samples.csv file with this content:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15

    Then run the following command:

    m2kcli digital ip:192.168.2.1 -9 channel=0,1,2,3 cyclic=1 buffer_size=16 < samples.csv

    As an experiment you can change the channel list; for example channel=1,2,3 and see how this affects your output.

    Best regards,

    Bogdan