512,754 active members
3,627 visitors online
Register for free
Login
IndustryArena Forum > Machine Controllers Software and Solutions > PlanetCNC > How to read output relay state on TNG script
Results 1 to 2 of 2
  1. #1

    Join Date
    May 2019
    Posts
    20

    Post How to read output relay state on TNG script

    I am in the process of writing a TNG script that needs to evaluate the state of two output relays. As an example, relay 1 and 7 need to be confirmed as on/off at the hardware level in order for the script to do something.

    Reading the state of inputs under M67 is no problem given that Q is used to store the values ... but in the case of outputs under M62 ... Q is used differently and I have yet to figured out how to reference individual pins using #<_hw_output>

    Any help with the syntax would be much appreciated.

  2. #2
    Moderator PlanetCNC's Avatar
    Join Date
    Mar 2017
    Posts
    465

    Re: How to read output relay state on TNG script

    Perhaps this example will help.

    Code:
    #<_TEST1> = [AND[#<_HW_OUTPUT>,1] GT 0]
    #<_TEST2> = [AND[#<_HW_OUTPUT>,2] GT 0]
    #<_TEST3> = [AND[#<_HW_OUTPUT>,4] GT 0]
    #<_TEST4> = [AND[#<_HW_OUTPUT>,8] GT 0]
    (PRINT,1:#<_TEST1,0> 2:#<_TEST2,0> 3:#<_TEST3,0> 4:#<_TEST4,0>)
    Let me know if you need more explanation

Similar Threads

  1. wiring a 5vdc solid state relay to output pins 1.14.16.17 on a c10 board
    By ProtoXNH in forum DIY CNC Router Table Machines
    Replies: 0
    Last Post: 10-29-2016, 04:37 PM
  2. 24Vdc Solid State Relay not the same as mechanical relay??
    By cjchands in forum General CNC Machine Related Electronics
    Replies: 7
    Last Post: 11-10-2010, 07:40 AM
  3. Using a solid state relay as a main stop relay
    By garagefela in forum General CNC Machine Related Electronics
    Replies: 4
    Last Post: 02-26-2010, 11:27 PM
  4. Will not Read S and F. What does state number mean
    By I_V_A_R in forum Controller Cards
    Replies: 0
    Last Post: 11-10-2008, 02:46 PM
  5. Solid state relay
    By N4NV in forum General CNC Machine Related Electronics
    Replies: 13
    Last Post: 05-07-2006, 06:19 AM

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
  •