Author Topic: Does Online Monitoring slow down the program  (Read 10996 times)

DLUN

  • Newbie
  • Posts: 18
    • View Profile
Does Online Monitoring slow down the program
« on: February 11, 2010, 07:49:09 AM »
Hi.

I am trying to make a moving average filter that averages the first and last 60 samples of code. I am trying to sample 30  different thermocouples every second from my datalogger using RS485 at 9600 baud rate.

my program basically runs a for loop every second. THe for loop wraps 30 times saving the result of different addresses of the data logger each time it wraps.

I have viewed this using the online monitoring and have found it to take up to 5 seconds for the for loop to complete its 30 reps.

Is it acting slow because I am in online monitoring mode? Or is the PLC just not fast enough to perform this task? Or do you think  it is the 9600 baud rate that is the weakest link?


Thank you.



support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Does Online Monitoring slow down the program
« Reply #1 on: February 11, 2010, 08:45:12 AM »
Sounds like the serial port speed is the limitation. Also what kind of communication protocol? How much delay does the datalogger take before it respond to a command from the PLC? You can compute the number of bytes required to retrieve 60 samples from the datalogger based on these data.

At 9600bps and 10 bits per byte, you only can send + receive not more than 960 bytes per second. The delay time in the RS485 response will decrease this figure significantly. I don't see it being able to handle 30 samples of 30 thermocouple data per second (i.e. 900 data samples per second).
« Last Edit: February 11, 2010, 08:47:16 AM by support »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

bongofury

  • Newbie
  • *
  • Posts: 10
  • I'm a llama!
    • View Profile
Re:Does Online Monitoring slow down the program
« Reply #2 on: February 19, 2010, 09:27:37 PM »
DLUN,
At the risk of not knowing what application you are using for monitoring the 30 thermocouples, or why it is important to check them every second, I would like to add my 1 1/2 cents worth.
   As you probably know, thermocouples are subject to what is known as "thermal inertia" meaning it takes time for the thermocouple to react to a change in temperature.  Especially when a thermocouple is cooling down. Heat goes to cold. Whether cold is room temperature, or any other reference point, it dictates how fast a thermocouple reacts to a cooling change, as opposed to a heating change.  I.E. it takes longer for a thermocouple to cool, because the change to warmer takes energy, whereas the cooling process takes no energy.  Cold can be defined as an infinite heat sink (Earth, Factory, test environ or Space) and heat as a localized event, in terms of a Delta T, ambient vs. desired process variable (fish sticks cook better at 400 F than at ambient) in respect to the limitations, (Earth, Factory, test environ or Space).
  To add to the equation, the distance of the heating (or cooling)
body or element, from the thermocouple's aspect, is inversely proportional to the square of the distance from said body or element.  The placement and location of the thermocouple needs to be taken into consideration when evaluating raw data.
   In short, it may be beneficial to extend the sample times, of the thermocouples, to 2 1/2 to 5 seconds. It might result in a more representive temperature change during the measured process and it will make the asssociated PID loops ( if used) easier to manage.  And, it will reduce the load on the communication network (RS-485).
   I hope I have not wasted anybody's time reading this......

Dave