FlexLogger

cancel
Showing results for 
Search instead for 
Did you mean: 

Flexlogger Sequence Plugin

Hello everybody, 

 

i want to automatize a sequence in Flexlogger, but unfortunately i don´t have LabView. There is a Plugin availabe, which can hopefully be adapted, this is saved in the attachment.

I´m using a cDAQ-9179 and a NI-9481 Relay-Card. I want to have the following sequence:

 

Step 1: Line 0 of NI-9481 switched on, Line 1 of NI-9481 switched off for 120s

Step 2: Line 1 of NI-9481 switched on, Line 0 of NI-9481 switched off for 120s

This sequence should be repeated 50 times.

 

Can anyone explain me, how i can realize this in Flexlogger, or maybe adapt the Plugin in a way, that this is working as expected?

 

BR,

Andi

0 Kudos
Message 1 of 4
(2,442 Views)
0 Kudos
Message 2 of 4
(2,408 Views)

Hello ZY0ng, 

 

I´m aware of the posibility of using the Python API. I was testing it with the function to set the value of a channel, here the example of the NI-Website:

 

import os
import sys
from flexlogger.automation import Application
def main(project_path):
    """Launch FlexLogger, open a project, and sets the value of a channel."""
    with Application.launch() as app:
        project = app.open_project(path=project_path)
        channel_name = input("Enter the name of the channel to set the value of: ")
        channel_value = input("Enter the new channel value: ")
        channel_specification = project.open_channel_specification_document()
        channel_specification.set_channel_value(channel_name, float(channel_value))
        print("Channel value set. Press Enter to close the project...")
        input()
        project.close()
    return 0
if __name__ == "__main__":
    argv = sys.argv
    if len(argv) < 2:
        print("Usage: %s <path of project to open>" % os.path.basename(__file__))
        sys.exit()
    project_path_arg = argv[1]
    sys.exit(main(project_path_arg))

But this was unfortunately not working. I´ve always received an error, because i wanted to set the value of the NI-9481 Relais Module to "High". I´ve also tested it with the value "1". Each time flexlogger crashed, because flexlogger is expecting a FLOAT.

Can you maybe help me here?

 

BR,

Andi 

0 Kudos
Message 3 of 4
(2,400 Views)

I see that this was posted several months ago, so this may not be useful anymore to the original poster, but for anyone else who stumbles on this thread in the future, there is an Output Sequencer plug-in available for FlexLogger 2024 Q3 or later on the niflexlogger-plugins GitHub repo which could be used for this, as well as much more complex sequences. It is also included with installations of FlexLogger 2026 Q1 and later.

 

The sequence mentioned in the original post was:

Step 1: Line 0 of NI-9481 switched on, Line 1 of NI-9481 switched off for 120s

Step 2: Line 1 of NI-9481 switched on, Line 0 of NI-9481 switched off for 120s

This sequence should be repeated 50 times.

 

To accomplish this, you would add a new Output Sequencer plug-in and configure the following settings, then hit the Apply button.

Devin_K_1-1769699460817.png

 

After that, your sequencer will have two digital output channels listed in the Channel Specification table which will toggle every 120 seconds. You can map these to your 9481 channel by going to each DAQ channel and mapping the Source to the corresponding output of the sequencer:

 

Devin_K_3-1769699671321.png

 

By default this sequence will start immediately, run 50 times, then stop. You can reset it manually by clicking the "Reset sequence" button on the plugin in the Chanel Spec table. If you want more control over execution, you can use some of the other options in the "Sequence execution" section of the sequence settings to make it automatically reset when a test is start (optionally with a start delay), only run when a test is running, or even be tied to some other channel as a start trigger.  Each setting will have a description in the bottom-left of the UI, or you can refer to the readme in the GitHub link above for more information.

 

Hope that helps!

0 Kudos
Message 4 of 4
(1,784 Views)