News:

  • March 29, 2024, 01:11:39 AM

Login with username, password and session length

Author Topic: RAMPSOAK Profile From External Source  (Read 1044 times)

RBPLC

  • Hero Member
  • *****
  • Posts: 585
RAMPSOAK Profile From External Source
« on: September 09, 2019, 10:16:22 AM »
Is it possible to build a RAMPSOAK profile in Excel or a .csv file and import it into a BRX? What I'm looking to do is basically be able to replicate the functionality of a ramping temperature controller for which an operator can build a profile without knowledge of Do-More programming and then upload it into the BRX. Is there an easy way to do something like this?

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3652
    • Host Engineering
Re: RAMPSOAK Profile From External Source
« Reply #1 on: September 09, 2019, 10:43:20 AM »
Currently, no.

You could import it as an instruction and then write the program to the PLC, but as a "runtime" dynamic profile in D memory, no.

RBPLC

  • Hero Member
  • *****
  • Posts: 585
Re: RAMPSOAK Profile From External Source
« Reply #2 on: September 09, 2019, 11:18:03 AM »
Have you guys had any requests for this type of functionality? If Do-More provided this functionality I could see the BRX supplanting profiling/ramping process controllers.

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3652
    • Host Engineering
Re: RAMPSOAK Profile From External Source
« Reply #3 on: September 09, 2019, 12:26:55 PM »
Yes, but it was more of a "wouldn't it be cool if...".  You may be the first.

We already support variable RAMP targets and variable RAMP times and SOAK times.  Is this not what you need?

RBPLC

  • Hero Member
  • *****
  • Posts: 585
Re: RAMPSOAK Profile From External Source
« Reply #4 on: September 09, 2019, 01:08:31 PM »
Variable ramp and soak times are part of it but I would also need the ability to change the number of ramps/soaks and re-configure their order.

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3652
    • Host Engineering
Re: RAMPSOAK Profile From External Source
« Reply #5 on: September 09, 2019, 02:23:01 PM »
You could hack something now with zero soak time or zero ramp time to the identical step end point.

Say your max profile is 6 steps, and this is one:
Step 1. RAMP to 10.0 over 1 minute
Step 2. SOAK for 2 minutes
Step 3. RAMP to 30.0 over 3 minutes
Step 4. SOAK for 4 minutes
Step 5. RAMP to 50.0 over 5 minutes
Step 6 SOAK for 6 minutes

then say you have something like
Step 1. RAMP to 70.0 over 7 minutes
Step 2. SOAK for 8 minutes
Step 3. RAMP to 90.0 over 9 minutes
Step 4. SOAK for 10 minutes

then make the last 2 steps be
Step 5. RAMP to 90.0 over 0 minutes (same end point as step 3, 0 time)
Step 6 SOAK for 0 minutes

Have a Ramp block of REAL, RampTime of signed DWORD, and SoakTime of signed DWORD.  Or even better, a UDT with a REAL .EndPoint and signed DWORD .TimePeriod members (re-using .TimePeriod for both RAMP and SOAK).  You could use the File System to load a table of that UDT (parse the .CSV file from the file system).  Or possibly use HTTPCMD to GET the values from a server (an array of JSON records would be slick coming from a server).

RBPLC

  • Hero Member
  • *****
  • Posts: 585
Re: RAMPSOAK Profile From External Source
« Reply #6 on: September 10, 2019, 04:54:03 AM »


You could use the File System to load a table of that UDT (parse the .CSV file from the file system).


I haven't done anything like this before. Could you elaborate a little more. Are there specific commands for parsing a .csv?

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3652
    • Host Engineering
Re: RAMPSOAK Profile From External Source
« Reply #7 on: September 10, 2019, 09:04:29 AM »
FILEOPEN
WHILE data left
FILEREAD  // read 1 line
Parse/Extract values
WEND
FILECLOSE

FILEREAD lets you read a line at a time (CR/LF delimiters, default)
The "hard" part is parsing/extracting the values.  That requires looping through the line, extracting "tokens" using STRFIND (e.g. numbers separated by spaces/commas/whatever), then doing converting those number strings into actual numbers using STR2INT or STR2REAL.

I would recommend you do that part last.  Get the RAMPSOAK part working using a block of UDTs.  Once you have that working, then you will have an idea of how the file text can map into your UDT block.

Do you have an idea of what a single line in the file would contain?  You could do something like the following based on my example:

R, 10.0, 1
S, 2
R, 30.0, 3
S, 4
R, 50.0, 5
S, 6

I used minutes as the resolution.  You could even do minutes as a real number, so you could do
S, 1.5
that would result in a SOAK step of 90 seconds

If you need help with the UDT definition, let us know.