Skip to main content
Writing LuaCEP rules
Updated over a week ago

How do I send data online using LuaCEP?

  1. Choose your signal: From the list of valid signal names you received, choose the one you want to monitor, say ZSG1_KABBALISTISCHE_DG1.

  2. Set up data transmission:
    Add the following lines to a file:

    • For updates every 30 seconds:

    • For detailed records every second:

    • More generally, logger has a customizable period (minimum 1 second). Fo example, to send data every 10 seconds, use:

  3. Upload the rules online, or update existing rules with this code.

  4. Deploy your rules.

How do I rename a signal?

  1. Choose your signal: From the list of valid signal names you received, choose the one you want to monitor, say ZSG1_KABBALISTISCHE_DG1.

  2. Choose the new name: Determine the new name you wish to give the signal, say “pretty_name”.

  3. Set up data transmission:

    Add the following lines to a file:

    • For updates every 30 seconds:

    • For detailed records every second:

  4. Upload the rules online, or update existing rules with this code.

  5. Deploy your rules.

How do I scale (multiply by a constant) a signal's value?

  1. Choose your signal: From the list of valid signal names you received, choose the one you want to monitor, say ZSG1_KABBALISTISCHE_DG1.

  2. Choose the multiplication factor: Determine the number you wish to multiply the signal's value with, say "10".

  3. Set up data transmission:

    Add the following lines to a file:

    • For updates every 30 seconds:

    • For detailed records every second:

  4. Upload the rules online, or update existing rules with this code.

  5. Deploy your rules.

How do I chain operations together?

  1. Choose your signal: From the list of valid signal names you received, choose the one you want to monitor, say ZSG1_KABBALISTISCHE_DG1.

  2. Choose the operations to chain: Determine the operations you wish to apply to your signal, for example: renaming and then scaling.

  3. Set up data transmission:
    Chain the operation using the “:” character.

    Note: the new lines in the code are not significant.

    Add the following lines to a file:

    • For updates every 30 seconds:

    • For detailed records every second:

  4. Upload the rules online, or update existing rules with this code.

  5. Deploy your rules.

How can I filter a signal’s value?

Filtering a signal’s value in LuaCEP allows you to process or send only those data points that meet certain conditions. This is particularly useful for focusing on specific ranges of data or values of interest.

  1. Choose your signal: From the list of valid signal names you received, choose the one you want to monitor, say ZSG1_KABBALISTISCHE_DG1.

  2. Implement the filtering logic: Use above(), below(), or is() processing blocks to apply your filter criteria. Here are some examples:

    You can chain a filter like any other building block.

  3. Upload the rules online, or update existing rules with this code.

  4. Deploy your rules.

How can I measure how long a signal maintains a specific value?

  1. Select your signal: Choose the signal you need to monitor, such as DOOR1L_IS_OPEN.

  2. Determine the specific value: Say we want to determine how long the DOOR1L_IS_OPEN remain at 1.

  3. Implement duration measurement logic:
    Use the time_count building block as follows:

  4. Upload the rules online, or update existing rules with this code.

  5. Deploy your rules.

How can I measure the number of transitions as a binary signal?

  1. Select your signal: Choose the binary signal you wish to monitor, such as
    a door status signal indicating open (1) or closed (0). Let’s assume the signal is named DOOR1L_IS_OPEN.

  2. Implement transition counting logic:

  3. Upload the rules online, or update existing rules with this code.

  4. Deploy your rules.

How do I create an alert?

  1. Select your signal: Choose the signal you wish to create an alert about, say

    "LOCO_IS_ON_FIRE".

  2. Implement the alert logic:

  3. Upload the rules online, or update existing rules with this code.

  4. Deploy your rules.

Support

Do you still have questions? Go to the Railnova platform and click "Contact us" for help!

Did this answer your question?