Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - garysdickinson

Pages: [1] 2 3 ... 34
1
Technical support / Re: NANO-10 Analog Input Protection
« on: August 18, 2025, 11:08:21 PM »
Nano-10 analog inputs update.

I did actually destroy one NANO-10 by connecting both ADC  inputs to 20 VDC.  This seems reasonable but stupid on my part.

The second and 3rd NANO-10s have not been damaged.  I simply wrote bad TBASIC code and the "flailing" ADC was the result of a a coding error.

Just wanted to come clean.

Gary Dickinson

2
Technical support / Re: NANO-10 Analog Input Protection
« on: August 13, 2025, 11:09:09 PM »
I am very certain how I destroyed the 1st PLC.  I am using inexpensive 4..20 mA signal generators that can, also, output 0.20 VDC. I screwed up and sent 20 VDC into both ADC inputs.  Not too bright on my part.

I tried to be much more careful with the 2nd NANO-10.  Both ADCs worked with 4-20 mA signals. I then worked on refining my digital signal processing software using ADC[1].  I then added in ADC[2] to my test code snd found that ADC[2] was not working.  I don’t know how I damaged the 2nd PLC, but I did.

I have found a 3rd NANO-10 in my collection of PLC stuff. I will see if it works and add the input protection circuitry.  If I can’t get it working I will order another NANO-10.

Regards,

Gary Dickinson

3
Technical support / NANO-10 Analog Input Protection
« on: August 13, 2025, 01:35:52 PM »
I've run into a bit of a problem with the NANO-10 Analog Inputs.  I have damaged the inputs on 2 of my NANO-10 boards.

I have attatched a schematic of a possible input protection circuit.  I am looking for feed back.

The sensors that I am working with output a 4 to 20 mA current source.  The 250 ohm resistor converts this to voltage between 0 and a bit less than 5 VDC.  I am aware of the 2K input impedance of the analog inputs.

The 5.1V Zener diode is an attempt to limit the voltage that the analog inputs "see". The Zener is supposed to clamp the voltage to about 5.1 VDC max and if the input voltage goes below ground the Zener will behave like a normal diode and clamp the low voltage to about -0.7 VDC.

The 120 Ohm resistor just limits the current that flows in the circuit and does not affect the accuracy of the measurement (the sensor outputs current and not voltage). The 0.01 uF capacitor is an attempt to bypass transient events to ground.

Gary Diuckinson

4
Technical support / Analog ground point for Nano-10
« on: June 10, 2025, 09:32:36 AM »
I am working with a Nano-10 to work with 4-20 mA sensors.

The Nano-10 does not appear to have an analog ground connection.  The best that I can do is connect the free end of the current sense resistor to my common DC bus.

I am concerned about minimizing noise pickup by the ADC circuitry.

Is there a spot on the Nano-10 that I could solder onto as an analog ground?

Gary Dickinson

5
Technical support / Re: PID control of two contradictory PWM signals
« on: March 01, 2024, 08:23:11 AM »
Pete,

I am glad you found something useful.

I have used several of the T100MD PLCs.  I had one run for 15 years with out a glitch.

If you have questions on algorithms and such just ask. I am happy to share.

Gary d

6
Technical support / Re: Can't connect to TLServer with FileZilla
« on: February 24, 2024, 03:56:22 PM »
Getting FileZila to communicate with the TRI PLCs is a little tricky.  FTP is a protocol that dates back to 1971 before TCP/IP or the internet existed. The FTP support built in the the TRI Nano10 PLCs is very limited in what it can support.  You must configure FileZila very carefully to get it to work.

The two big issues is that the FMD PLC can only support a single FTP connection at a time. The FMD PLCs only work with text ASCII text files. The TRI PLCs do not use meaningful time stamps on the files.

OK. Your question talks about the "TLServer". The Nano10 has a builtin Ethernet support and builtin FTP support and does not require the TLServer application to function. If you are actually running TLServer on your PC you will fail.

If your Nano10 and PC are connected via Ethernet to a common network on the same sub net  then you should be good to go.

I have attached a .pdf to this reply that is screen shots of the current version running on a Windows 10 PC and communicating with a FMD series PLC. The Nano10 and the FMD PLCs behave identically when it comes to FTP.

Best of luck,

Gary Dickinson

7
Technical support / Re: PID control of two contradictory PWM signals
« on: February 23, 2024, 01:13:40 PM »
The programming of the FMD PWM ouputs to meet your needs is not very difficult.

I've attached a .pdf file that shows the programming for 1 of the 2 PWM outputs that your application may need.

The programming for the 2nd PWM output is the same but uses the slope/incercept values for the other channel.

You still have to solve a host of other things.


Gary Dickinson

8
Technical support / Re: Reading a string using MODBUS RTU
« on: February 25, 2023, 05:04:16 PM »
Lorne,

I pass strings back and forth between Weintek HMIs and TRI PLCs.  Weintek uses arrays of integers to store strings and packs 2 8-bit characters in each 16 bit value. 

This is the code that I use to convert a PLC string variable into an array of registers that can be accessed via Modbus. The HMI reads/writes 16 sequential registers in the PLC to read/write string data. I picked an array size of 16 16-bit integers. This will support strings up to 32 characters.

' Copy Installation Name String from a$ to DM[] so that it can be accessed by the
'   Weintek HMI as an array of 16-bit Modbus registers
'
n = InstallationName    ' starting word in DM[] to build the data for the HMI

' SizeInWords is defined as 16.  16 sequential DM[] locations.
'
for i = 1 to SizeInWords step 2

    ' Two 8-bit ASCII characters are packed into each 16-bit DM value
    '
    ' The Weintek HMI expects strings to be packed into sequential 16-bit words.
    ' The first character in a string is in the LSB of the first word
    '   The second character will be in the MSB of the frist word.
    '
    ' The rest of the bytes are filled with 0x00. This keeps the HMI string object
    '   sane.
    '
    ' Please note that asc() is spec'd to return 0x00 when index is beyond
    '   the end of the string, A$.  It seems to do this in test. This
    '   usage ensures that the entire DM[] array is 0 filled beyond the end
    '   of the string characters.
    '
    DM[n] = asc(A$,i+1) * 256
    DM[n] = DM[n] + asc(A$,i)
    n = n + 1           ' next word in DM[]
next


Gary Dickinson

9
Technical support / Re: Input[1] to Input[5] Operation
« on: January 06, 2023, 01:25:10 PM »
Your attempt to use INPUTs as general purpose data storage has a small problem. When the PLC ladder logic is running it will overwrite all of the INPUT values during each scan of ladder logic. You are using INPUTs that your PLC does not physically have but the ladder logic code does not know how many INPUTs your PLC actually has (or are actually being used) so it scans  the maximum number of INPUTs that ladder logic can handle.  This number is way more that 16. This is why your are seeing your "special" INPUTs getting cleared to 0.

I suggest that you store data in either DM[] or RELAYs. If you store your DATA in RELAYs you can make it visible on the first page of the simulator / on-line monitor.

If you insist on using INPUTs for data storage you may need to use the SetSystem 16,n statement on the the first scan of your PLC program. The SetSystem 16,n sets the number of I/O pins that will be accessed.  The "n" argument affects the number of I/Os to access. When n=1 the I/0 pins 1-16 will be scanned. When n=2 then pins 1-32 will be scanned.

SetSystem 16,n is intended to help speedup the execution of ladder logic by restricting the number of I/Os that must be processed on each pass thru the ladder logic.

I use SetSystem 16,n for it's intended purpose to speed up the ladder logic execution. It works for this purpose You will need to test and verify if SetSystem 16,1 will solve the problem that you have created. 

Gary Dickinson

10
Technical support / Re: goto command
« on: December 21, 2022, 10:46:51 AM »
Pete,

it sounds like you are working on a fairly complex problem.

As you have figured out the TBASIC language does not have any sort of computed GOTO or computed CALL functionality.  So your choices are to either make the computed CALL using a CF or to do it in ladder logic.

I am guessing that your code is using the variable SeqNo to make decisions.  Most of my  non-trivial  PLC  programs work in this manner. 

The PLCs allow you to use COUNTERs 1..8 as "sequencers". The Present Value of these Sequencer/Counters can be tested in ladder logic and the Preset Values can be changed in ladder logic.  When used as Sequencers you are limited to the values of 0..31.

    I use this mechanism for many reasons:
    • Ladder logic is faster than TBASIC in making these decisions
    • The SeqNo is visible for debug both in simulation and on-line monitoring.
    • The SeqNo can be changed during debug to force code to run. for debug.
    • it provides a method to support multiple threads of operation. Poor-man's multitasking.


This approach scares most PLC programmers because it sounds too complex.

If you are interested, I have posted many examples of this sort of approach.  I’d be happy explain how it works.

Gary d


11
Technical support / Re: goto command
« on: December 20, 2022, 03:39:28 PM »
I have been writing code for the TRI PLCs for nearly 20 years and have not found a use for the GOTO statement.

I would use the following coding structure for your code:

if SeqNo = 1
    ' code for SeqNo 1
elif SeqNo = 2
    ' code for SeqNo 2
elif SeqNo = 3
    ' code for SeqNo 3
elif SeqNo = 10
    ' code for SeqNo 10
else
    ' code if the SeqNo is not not 1,2,3, or 10 ...
endif

I think that this approach is easier to read and maintain.  Note that "elif" is identical to "elseif" keyword. I just like the shorter version.

Regards,

Gary Dickinson

12
A long time back I worked with the pre-production Wx100 product using any of a number of versions i-TRiLOGI that were test builds.

I got an email from a Wx100 user and he was having problems with compiling a Wx100 program that I wrote.

The affected file is named "Wx100 Simple Menu V1_12.PC7.

The problem is that this demo code was written with an early version of i-TRiLOGI when the "Comment" field was added to the #define mechanism.  The current tool set V7.5 Build 14 uses a different field separator in the .PC7 file than was used by the early version that I wrote the code with...

The early version used commas as field separators in the PC7 file. Sort of like this:  #,Defined Name,Value,Comment
The current tool set uses commas and an ASCII <RS> (record separator). Looks like this: #,Defined Name,Value<RS>Comment

The problem is that my "old" code when compiled with current tools doesn't recognize the "," before the Comment field so the Value field ends up with the correct "Value" a comma and then the Comment text.  The Comment field is always empty.

I was able to fix the problem for the user, by exporting the #Define Table to a text file and replacing the first "," character by an ASCII TAB character and then importing the edited #Define table back into the PC7 program.  The edited #define table now works perfectly and if I peek into the PC7 file I see the <RS> character in the correct spot.

I have attached the corrected .PC7 file.  It is now named "Wx100 Simple Menu V1_13.PC7.  The only changes from the V1_12 file is the corrected #define and I added a comment for the V1.13 version to give a hint as to why it was changed.

I think that the V1.12 version may appear in in the Wx_Specifics directory and in a Zipped file named "Wx100 Simple Menu.  Is this something that you can fix in a future release?

Best regards,

Gary Dickinson


13
There isn't a Special Clock Pulse bit with a period of 2 seconds.

But there is a 1 second period clock named "Clk:1.0s.

You can use a COUNTER to generate a 2 second clock from Clk:1.0s

The trick is to make the COUTNER count up with the use of special function coil, [UpCntr].

A COUNTER with a set value of 1 will count 0,1,0,1... as an up-counter. The contact for the COUTNER will be active on the "0" count time period.

I have attached a screen shot of of the ladder logic to get this to happen.

Good luck,
   
Gary Dickinson

14
Technical support / Re: PLC INPUT Interrupt Behavior
« on: November 07, 2022, 01:34:35 PM »
Lorne,

I think your approach is reasonable. 

The feedback that I got from TRI is that the behaviors vary by PLC family. 

1. The Wx100 is based on a very different processor and the state of the physical INPUTs may continued to be visible to ladder logic while being used as an interrupt source. This is not the case with Fx based PLCs or the older FMD based PLCs.

2. There is some sort of debounce logic on INPUTs to filter out bounces that show up with mechanical contacts.  This mechanism is turned off for those INPUTs that are being used as INPUTs on some PLC  families.  The debounce mechanism is be based on ladder logic scan boundaries and may require more than a single scan to get settled.

The bottom line is that it can take one or more full scans of the ladder logic on most PLC families from when an INPUT interrupt is disabled until that INPUT's true state is visible to ladder logic.

Thanks for helping me think through this stuff.

Gary d






15
Technical support / Re: PLC INPUT Interrupt Behavior
« on: October 09, 2022, 05:41:22 PM »
I am using the EZWire-1616.

I am using the edge triggered interrupts to terminate a stepper motion on the edge of a limit switch.  I am running the stepper at a very low step rate with no acceleration.  This way the StepStop command will stop the motion as close to the edge event as possible w/o the stepper losing position.

If I do this without using the interrupt system the the stepper can be 50 steps past the edge event as I am limited by the ladder logic scan rate.  Without using interrupts, I have to issue  a one-step motion command to detect the edge event.  These steps are limited by the ladder logic scan rate.  I can get 20..50 pps out of ladder logic.  My stepper hardware can run at 1000 pps and be stopped with StepStop without losing position.  ISR edge detection saves about 8 sections for each stepper based positioner.

If I had 4 additional INPUTS, I could wire 2 PLC inputs in parallel for each limit switch input.  This would get me both ISR and ladder logic visibility to the limit switches.  I will still have to disable the ISRs either by disabling them or substituting a non functional CF for those times when I don’t want the stepper system to be stopped on edge events on the limit switches.

    What how I think that the PLC handles INPUTs and INPUT interrupts:
    • Physical INPUT states are scanned and registered once per scan of the ladder logic. If an INPUT is acting as an interrupt source it’s valve when viewed by ladder logic is always 0, independent of the voltage on the INPUT pin.
    • INPUT interrupts are handled synchronously to the ladder logic scans.  I believe that these are handled directly by the PLC’s CPU. My ISR sets a RELAY to indicate that the edge condition was detected. My ISR, also turns off the INTERRUPT system for the the INPUT before exiting.
    • Ladder logic contacts, INPUTS included, can be differentiated or edge sensitive.  To detect an edge requires 2 successive scans of the ladder logic.
    • I suspect that it takes 2 full ladder scans to get the INPUT state correct after an INPUT interrupt is turned off. But because of the asynchronous behavior of the ISR, it may take a 3rd scan of the ladder logic to get the INPUT working.  My test code counts the number of scans from when a rising edge ISR runs until ladder logic detects the the INPUT is non-zero.  This code sees 2 full scans for about 9 out of 10 tests and 3 scans about 1 out of 10.

    I don’t think that I am observing contact or switch bounce.  I disable the ISR in the ISR routine. I would like to believe that your system level code would disable the CPU ISR before the PLC ISR code exits. Even if the ISR executed 2x, the PLC code will see only a single event from the ISRs.

    I believe that waiting 3 scan times following the ISR detected edge event will allow the PLC INPUT logic to return to "normal" (digital filtering is working), differentiated INPUTs working, …

    As you know, I am just guessing how the PLC operates. I am just picking your brains to see if I am missing something.  I appreciate anything that you can think of.

    Regards,

    Gary Dickinson


Pages: [1] 2 3 ... 34