TNGv2 Possible bug with (array)

Results 1 to 4 of 4

Thread: TNGv2 Possible bug with (array)

  1. #1
    Member theRat's Avatar
    Join Date
    Jun 2017
    Location
    Australia
    Posts
    71
    Downloads
    0
    Uploads
    0

    Default TNGv2 Possible bug with (array)

    Since there is no documentation/examples that I can find about (array) I had a guess as to how it works, but have come across some strange behaviour. With the following script I would expect the same results, but they differ.

    Code:
    ; _spindlespeed set to 12000
    (clear)
    
    
    (print,This doesn't work)
    (array,4000,SHR[[#<_spindlespeed>*100/60],8],AND[[#<_spindlespeed>*100/60],255])
    (print,#4000)
    #<i> = 0
    O<print> repeat [#4000]
        #<q> = [#[4001+#<i>]]
        (print,#<q,0>)
        #<i> = [#<i>+1]
    O<print> endrepeat
    
    
    
    
    
    
    (print,This does work)
    #<speed_lo> = SHR[[#<_spindlespeed>*100/60],8]
    #<speed_hi> = AND[[#<_spindlespeed>*100/60],255]
    (array,4000,#<speed_lo>,#<speed_hi>)
    (print,#4000)
    #<i> = 0
    O<print> repeat [#4000]
        #<q> = [#[4001+#<i>]]
        (print,#<q,0>)
        #<i> = [#<i>+1]
    O<print> endrepeat
    The output I get is:

    Code:
    This doesn't work
    4.000
    1
    8
    16
    255
    This does work
    2.000
    78
    32

    I don't understand why it is different and the wrong output contains more data than I expected and it seems completely wrong. I hope you can explain.

    Thanks
    Simon

    Similar Threads:


  2. #2
    Moderator PlanetCNC's Avatar
    Join Date
    Mar 2017
    Location
    Slovenia
    Posts
    488
    Downloads
    0
    Uploads
    0

    Default Re: TNGv2 Possible bug with (array)

    (array) will not evaluate expressions.



  3. #3
    Member theRat's Avatar
    Join Date
    Jun 2017
    Location
    Australia
    Posts
    71
    Downloads
    0
    Uploads
    0

    Default Re: TNGv2 Possible bug with (array)

    Ok. Maybe it should throw an error if you try?



  4. #4
    Moderator PlanetCNC's Avatar
    Join Date
    Mar 2017
    Location
    Slovenia
    Posts
    488
    Downloads
    0
    Uploads
    0

    Default Re: TNGv2 Possible bug with (array)

    Ok, error then.



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
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

TNGv2 Possible bug with (array)

TNGv2 Possible bug with (array)

TNGv2 Possible bug with (array)