509,967 active members
3,174 visitors online
Register for free
Login
Results 1 to 3 of 3
  1. #1
    Moderator PlanetCNC's Avatar
    Join Date
    Mar 2017
    Posts
    400

    [TNGv2] - Expr.txt

    Expt.txt file is inside profile folder. It is useful for simple scripts that need to be run periodically. It is executed on every screen refresh. Each line is single expression statement.

    Here is an example of Expr.txt with two expressions (two lines). First line checks if controller is connected. If it is not then "_concheck" parameter in increased and status line is updated. Second line checks if "_concheck" parameter is greater then 100. It it is then command "Reconnect" is executed, status is cleared and parameter is set to zero.

    To test this example put Expr.txt file to profile folder and restart TNGv2. Unplug USB cable from controller and observe status line. Then plug USB back to controller and controller will be reconnected then parameter counts to 100.

  2. #2
    Registered
    Join Date
    Jun 2017
    Posts
    51

    Re: [TNGv2] - Expr.txt

    This looks pretty cool. Just wondering if there is a way to query an I2C device using this? I'm thinking about if it is possible to monitor some external sensor (ie. air pressure) and have them displayed within TNG. I am not sure how useful this would be, but it might be cool to be able to pause a program if the available air for cooling dropped below a certain pressure and resume when the compressor recharges. Doing that would probably cause different problems, but it's just a thought about what this might be useful for.

  3. #3
    Moderator PlanetCNC's Avatar
    Join Date
    Mar 2017
    Posts
    400

    Re: [TNGv2] - Expr.txt

    I2C is G-code command. You can not execute g-code command while your program is running.
    There is more elegant solution using USB expansion feature. For start take a look at Arduino example included in API. I will create another one with your scenario in mind for next Friday release.

Similar Threads

  1. TNGv2 for Mac OSX
    By tantemay in forum PlanetCNC
    Replies: 44
    Last Post: 11-26-2019, 05:39 PM
  2. [TNGv2] - 2019-11-08
    By PlanetCNC in forum PlanetCNC
    Replies: 0
    Last Post: 11-09-2019, 02:15 AM
  3. [TNGv2] - Files and folders
    By PlanetCNC in forum PlanetCNC
    Replies: 0
    Last Post: 11-02-2019, 10:46 PM
  4. [TNGv2] - 2019-10-28
    By PlanetCNC in forum PlanetCNC
    Replies: 0
    Last Post: 10-28-2019, 04:52 PM
  5. [TNGv2 - API]
    By PlanetCNC in forum PlanetCNC
    Replies: 0
    Last Post: 10-27-2019, 11:23 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •