You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

Reply
 
Thread Tools Display Modes
Old February 22nd, 2021, 11:01 AM   #1
wjethro
Member
United States

wjethro is offline
 
Join Date: Mar 2020
Location: Los estados unidos
Posts: 5
link Linux file names to Dynamic factorytalk view list

Long time reader here but don't post much as I usually find the answers I need in the forum search. I am trying to create a dynamic selection list on a Panelview plus standard 7 panel. Is there a way to have a dynamic list of variables that is referenced from a Linux system?

For more detail:

I have a Ubuntu 18 OS that a user creates and runs programs for a certain process. All of these program files are saved in the same folder and have the same file extension. The PLC is a 1769-L30ERM that controls outside automation processes. I can control processes by passing tags back and forth on the network at appropriate times ie. Start and Stop and Fault bits. A particular customer wants to be able to add new progams in the Linux system which would be new programs with the same extension as the previous programs and then be able to select them from the RA HMI. The way I am currently achieving this is through a string match. The program in Linux and the String entered in the tag must match and then the programs work together. Is there a more operator simple way to do this with Linux and RSLogix? Thanks for any input.
  Reply With Quote
Old February 22nd, 2021, 12:31 PM   #2
drbitboy
Lifetime Supporting Member
United States

drbitboy is offline
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 2,322
Do you want
  • the Linux box to push (write) and populate the list to the Panelview, triggered by an action or event on the Linux box UI
  • OR
  • the Panelview to pull (read) and populate the list from the Linux box, triggered an event on the Panelview
  • or both?
I don't know Panelview at all; I wonder if it might be easier to keep the list on the PLC and use pylogix to put it there.
  Reply With Quote
Old February 22nd, 2021, 12:55 PM   #3
dmroeder
Lifetime Supporting Member
United States

dmroeder is offline
 
dmroeder's Avatar
 
Join Date: Apr 2006
Location: Vancouver, WA
Posts: 2,669
By "programs", do you mean "recipes"?

The PanelView won't be talking to your Linux system. You would point the PanelView to tags in the PLC and have your Linux system interface with the PLC. All the work should be done between your Linux system and PLC, the PanelView should just be displaying.

It sounds like you might be wanting to write new "recipes" from you Linux system to your PLC, the operator can select these new recipes from the HMI. The basic idea, assuming that I understood correctly, would be to create a UDT for your recipe, then declare an array of your UDT. Selecting from the PanelView, the operator would scroll through the array selecting which one they want to run. You Linux system would update the array with new recipes as you need to.
  Reply With Quote
Old February 22nd, 2021, 01:41 PM   #4
drbitboy
Lifetime Supporting Member
United States

drbitboy is offline
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 2,322
I think
  • the Linux basenames are the recipe strings
    • E.g. Load_Line_1.prg
  • The contents of each file comprise a "program."
  • Having the system execute the "program" in any Linux file, which file's basename is selected by the HMI, is already working
    • It sounds like the HMI selection method involves typing in the basename, perhaps without the extension
  • So the issue is automatically taking an updated list (ls; Python module glob) of the *.prg files in that directory of the Linux system, and loading that list into a view/select widget on the HMI, for a more convenient selection by the operator.
Am I close?


Does Panelview software have any programming capability (e.g. VBA)? Or an API e.g. can its widgets be written to? Can a view/select list even have a dynamic stable of strings?
  Reply With Quote
Old February 22nd, 2021, 03:02 PM   #5
wjethro
Member
United States

wjethro is offline
 
Join Date: Mar 2020
Location: Los estados unidos
Posts: 5
Earth

Quote:
Originally Posted by drbitboy View Post
I think
  • the Linux basenames are the recipe strings
    • E.g. Load_Line_1.prg
  • The contents of each file comprise a "program."
  • Having the system execute the "program" in any Linux file, which file's basename is selected by the HMI, is already working
    • It sounds like the HMI selection method involves typing in the basename, perhaps without the extension
  • So the issue is automatically taking an updated list (ls; Python module glob) of the *.prg files in that directory of the Linux system, and loading that list into a view/select widget on the HMI, for a more convenient selection by the operator.
Am I close?


Does Panelview software have any programming capability (e.g. VBA)? Or an API e.g. can its widgets be written to? Can a view/select list even have a dynamic stable of strings?

This is a good assessment. The programs on the Linux machine controls different systems than the PLC controls. It might be easier to put it as the PLC runs the Load process and the unload process. Once the system is loaded the Linux subsystem receives a run command from the PLC. Once the Linux process is complete it sends an unload tag to the PLC. The PLC then runs the unload portion of the process. The Linux sub-sytem process has user defined variables that are saved to a program name. The program name can be changed by the operator and I am currently doing this with a string match tag in the PLC. The operator can input a string on the HMI and it is passed to a tag value in the PLC. I have the logic add the end values to complete the program (like the .cc) Each time the Linux subsystem is told to start, the program string tag is passed and if it has a match that Linux program tag is loaded and runs.

Running a python script that assigned the program.cc tags in from a certain folder on the linux system to the PLC variables would work if that is possible, I have never done something like that.

My reading into the Recipe's on Rockwell seemed like a dead end because my understanding was that the Recipe tags were not available to be passed to other displays. This particular system will be integrated to other PLC systems that must be able to set and read the tag values.

As I mentioned I have the string match working between the PLC's and the Linux system but the operator must enter the "Linux_Program" into the HMI. It would make it easier for the operator if there were a way to create a list of "Linux_Programs_1" strings from the Linux programs. This is easy for me if I hard coded the system to pass the string tag but the customer wants to be able to add "New_Linux_Programs_50.cc" that the PLC would automatically pull up. Does that make better sense? Any ideas would be appreciated. I am looking into the .py script idea. Thanks

Last edited by wjethro; February 22nd, 2021 at 03:04 PM.
  Reply With Quote
Old February 22nd, 2021, 03:07 PM   #6
wjethro
Member
United States

wjethro is offline
 
Join Date: Mar 2020
Location: Los estados unidos
Posts: 5
Quote:
Originally Posted by drbitboy View Post
Do you want
  • the Linux box to push (write) and populate the list to the Panelview, triggered by an action or event on the Linux box U

I essentially would like to push the file names from the Linux folder to a PLC tag that matched the Linux value so the operator could pull down a multichoice list of these program names. This would allow the PLC to run the load process, pass the selected program name so Linux could run its process, and then allow the PLC to run the Unload process. Thank you

Last edited by wjethro; February 22nd, 2021 at 03:31 PM.
  Reply With Quote
Old February 22nd, 2021, 04:00 PM   #7
drbitboy
Lifetime Supporting Member
United States

drbitboy is offline
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 2,322
There is probably a better way to do it, but here goes.


Say there were N Linux programs, blah_00.cc, blah_01.cc, ..., blah_34.cc.


Python/pylogix could, I think, easily transfer all N into an array of strings (of length say N*10, or what honor dictates) on the PLC. This array is ALLPROGRAMS.



There is a second array of say 5 strings on the PLC, HMIPROGRAMS, and integer tag IBLOCK and ITOLOAD.



The panelview has a screen that has a display for 5 strings, a [previous 5] button, and a [next 5] button. When that screen is initially displayed (I don't know the terminology), it sends a 0 to IBLOCK in the PLC.


The PLC sees IBLOCK = 0 and moves the first five strings from ALLPROGRAMS, ALLPROGRAMS[0] through ALLPROGRAMS[4] into HMIPROGRAMS[0] trough HMIPROGRAMS[4].


The panelview displays the 5 strings in HMIPROGRAMS in this screen's 5 strings.



If the operator hits the [next 5] button, somehow IBLOCK becomes 1 on the PLC, which causes strings ALLPROGRAMS[5] through ALLPROgRAMS[9] to be moved to HMIPROGRAMS, which are then displayed on the Panelview screen (automatically, I assume?).


I assume the rest is obvious: [previous 5] somehow decrements IBLOCK, etc.


Either each string displayed is a button, or a button is next to each string, and that button sends a number between 0 and 4 to the PLC integer ITOLOAD.


When the PLC detects ITOLOAD is between 0 and 4, it makes the string HMIPROGRAMS[ITOLOAD] the next program to run. Maybe it also assigns -1 to ITOLOAD, which it ignores after that, but also to be ready for the next assignment to ITOLOAD by the HMI.

The ALLPROGRAMS array on the PLC could be dispensed with, and a 1Hz or 2Hz pylogix script/task could poll IBLOCK and load HMIPRGRAMS from the Linux host when it changes; that way neither the PLC nor the HMI are always only consumers of, and never responsible for, the program names, and the files in the Linux directory is the only source for those data.



So, that is what someone ign'nt of Panelview might try. Although it seems odd to me that that kind of recipe system does not already exist. The python part is trivial; the PLC part is trivial; I suspect the Panelview part is also trivial to someone who knows how to use Panelview.


I also found this post - https://www.plctalk.net/qanda/showth...7763#post47763 - in another old thread, but I don;t think it is what you are looking for.

Last edited by drbitboy; February 22nd, 2021 at 04:46 PM.
  Reply With Quote
Old February 22nd, 2021, 04:32 PM   #8
JordanCClark
Lifetime Supporting Member
United States

JordanCClark is offline
 
JordanCClark's Avatar
 
Join Date: Mar 2007
Location: Michigan
Posts: 540
Just the names, or is there other data, as well?
__________________
_____________________________
Jordan

Any man that can hitch the length and breadth of the Galaxy, rough it, slum it, struggle against terrible odds, win through and still know where his towel is, is clearly a man to be reckoned with.
-- Hitchhiker's Guide to the Galaxy
  Reply With Quote
Old February 22nd, 2021, 05:41 PM   #9
drbitboy
Lifetime Supporting Member
United States

drbitboy is offline
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 2,322
Trivial python prototype; error handling needs to be added
Attached Files
File Type: zip globtest.zip (1.1 KB, 3 views)
  Reply With Quote
Old February 22nd, 2021, 06:06 PM   #10
wjethro
Member
United States

wjethro is offline
 
Join Date: Mar 2020
Location: Los estados unidos
Posts: 5
Quote:
Originally Posted by JordanCClark View Post
Just the names, or is there other data, as well?
I am passing only the names. Other override data for the programs is being handled elsewhere as a DINT. I originally was going to create a Struct with all the necessary data but it became more tedious than necessary for the production process this is used for.
  Reply With Quote
Old February 22nd, 2021, 06:09 PM   #11
wjethro
Member
United States

wjethro is offline
 
Join Date: Mar 2020
Location: Los estados unidos
Posts: 5
Quote:
Originally Posted by drbitboy View Post
There is probably a better way to do it, but here goes.

Thanks drbitboy. I agree each process separately is easy to accomplish. It is getting them to work together with RSlogix is the challenge. I will run with your suggestion. I appreciate your time.
  Reply With Quote
Old February 22nd, 2021, 06:31 PM   #12
drbitboy
Lifetime Supporting Member
United States

drbitboy is offline
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 2,322
Quote:
Originally Posted by wjethro View Post
Thanks drbitboy. I agree each process separately is easy to accomplish. It is getting them to work together with RSlogix is the challenge. I will run with your suggestion. I appreciate your time.



Glad to help, let us know how it goes.


Are you using pylogix, or summat else? I found it robust and straightforward, so this design where the PLC is at the center, and Linux and Panelview only communicate with and through the PLC, and not with each other, should work out well, even if it feels like a bit of a kludge.
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
Factorytalk view studio ME messaging file error gerberz LIVE PLC Questions And Answers 0 March 13th, 2020 05:13 PM
Using image from a file on a Panel view plus 6 tomjohn01 LIVE PLC Questions And Answers 4 September 18th, 2017 02:05 PM
FT View SE Editing Without License Mark Cole LIVE PLC Questions And Answers 9 November 22nd, 2014 09:03 AM
Dynamic Par file in factorytalk View chunhwang LIVE PLC Questions And Answers 0 March 7th, 2014 10:34 PM
Loading a Value Using a Parameter File in FactoryTalk View MarkNightingale LIVE PLC Questions And Answers 2 June 15th, 2011 07:08 AM


All times are GMT -5. The time now is 08:30 PM.


.