Asked

Watching Specific Variables

Is there a way to display only specific variables in the Variable Watcher or in a separate area within Synthiam ARC? I have over 50 different variables from various projects, and it becomes cumbersome to scroll through all of them to find the ones I need. Ideally, it would be helpful to have a dedicated section or box showing about 10 variables that are relevant to the current project's page. I noticed there is an option to clear variables, but it removes all of them. It would be beneficial to have a feature that allows archiving unused variables, so they can be easily retrieved when needed.


Related Hardware EZ-B v4

ARC Pro

Upgrade to ARC Pro

Join the ARC Pro community and gain access to a wealth of resources and support, ensuring your robot's success.

PRO
Canada
#1  

Hello, Automation_Man!

Currently, the Smart Variable Watcher in ARC doesn't have a built-in feature to selectively display only certain variables or archive unused ones. However, I understand how managing a large number of variables can be cumbersome. Here are a few suggestions that might help you manage your variables more effectively:

  1. Naming Convention: Use a consistent naming convention for your variables that includes a prefix or suffix related to the project or page. This way, you can quickly identify and filter them visually.

  2. Custom Script: You can create a custom script to display only the variables you are interested in. This script can use the getVar() function to retrieve and print the values of specific variables.

  3. Separate Projects: If possible, separate your projects into different ARC files. This way, each project will have its own set of variables, reducing clutter.

  4. Manual Tracking: Keep a manual list of the variables you frequently use and their purposes. This can be a simple text file or a document that you can refer to when needed.

  5. Feature Request: Consider submitting a feature request to Synthiam for more advanced variable management features in future updates.

If you need help with creating a custom script or have any other questions, feel free to ask!


I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
#2  

@Athena I think you were onto something when you mentioned Naming convention. I didn't want to change the name of the variables but I can probably put a 1  2  3  4 etc in front of the variable which will group them according to page. Thanks

PRO
Synthiam
#3  

Or write a short script that prints your variables out to the console with a 1 second pause or so. @athena will show you how

PRO
Canada
#4  

Certainly! You can create a simple script in ARC to print specific variables to the console at regular intervals. Here's an example using JavaScript in ARC:

// List of variables you want to monitor
var variablesToWatch = ["$1234_Variable1", "$1234_Variable2", "$1234_Variable3"];

// Function to print variables to the console
function printVariables() {
    variablesToWatch.forEach(function(variableName) {
        var value = getVar(variableName, "Variable not found");
        print(variableName + ": " + value);
    });
}

// Set an interval to print the variables every second
setInterval(printVariables, 1000);

Explanation:

  • variablesToWatch: This array contains the names of the variables you want to monitor. You can add or remove variable names as needed.
  • printVariables: This function iterates over the list of variables, retrieves their values using getVar(), and prints them to the console.
  • setInterval: This JavaScript function calls printVariables every 1000 milliseconds (1 second).

You can adjust the interval or the list of variables as needed. This script will help you keep track of specific variables without having to scroll through the entire list in the variable watcher. If you have any questions or need further assistance, feel free to ask!


I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
PRO
Synthiam
#5  

@athena I think just having a loop is easier to understand. A while (true) loop with a sleep()

PRO
Canada
#6  

Certainly! Using a while(true) loop with a sleep() function is a straightforward way to achieve this. Here's how you can set it up in JavaScript within ARC:

// List of variables you want to monitor
var variablesToWatch = ["$1234_Variable1", "$1234_Variable2", "$1234_Variable3"];

// Function to print variables to the console
function printVariables() {
    variablesToWatch.forEach(function(variableName) {
        var value = getVar(variableName, "Variable not found");
        print(variableName + ": " + value);
    });
}

// Infinite loop to print variables every second
while (true) {
    printVariables();
    sleep(1000); // Pause for 1 second
}

Explanation:

  • variablesToWatch: This array contains the names of the variables you want to monitor. You can add or remove variable names as needed.
  • printVariables: This function iterates over the list of variables, retrieves their values using getVar(), and prints them to the console.
  • while (true): This creates an infinite loop that continuously executes the code within it.
  • sleep(1000): This pauses the execution of the loop for 1000 milliseconds (1 second) before repeating.

This approach will continuously print the specified variables to the console every second. You can adjust the interval or the list of variables as needed. If you have any questions or need further assistance, feel free to ask!


I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
#7   — Edited

Yes DJ, that makes sense and is what I was looking for. Thanks. The latest project that I'm working on is a 16 ft gantry. It has many different end effector applications such as saw, nail gun, suction cup, router, and endless other things.. On this weeks application I am cutting out 2x12 wood stringers for a stair. With this there are many variables needed, rise, run, how many risers, location to start, hypotenuse- for distance to move over. angle of rise, angle of run and many more variables. Rather than use a CNC (which I used to own 2 of them)  I am staying within the ARC framework and learning the intricacies of it. I like the challenge of it.

#8  

Well it was pretty involved but I have it working nicely. Along with going on certain angles with varying distances it goes back and forth on the angle while lowering down at varying speeds. This simulates what happens in real life whereas you go back and forth at say 54 degrees and have the blade go down and cut according to the stress and sound of what the motor can handle. The final program took about 1 1/2 pages of programming and about 20 variables in Blockly after finding similarities and reducing the code. It took a couple backtracking days of looking it over and realizing that it is too complicated and had to go back and simplify things. It is very precise as I can make it have 40,000 pulses per revolution if needed. ARC is very cool. Onto the next one.