Changing a windows document name from a PLC

healey_bruno

Member
Join Date
Apr 2008
Location
Montreal
Posts
4
Hi!
I would like to rename a document (pdf) in Windows with a variable from my PLC. I'm using a CompactLogix PLC with FactoryTalk View ME.

FactoryTalk view ME run on an industrial PC with Windows 7 pro.
There are some pdf automaticaly created on this PC and I would like to rename them after a variable from my compactlogix.

Does anybody know a way of doing this?

Thanks!!
 
That's a fun question.

Do you have an RSLinx Gateway license, and Microsoft Excel? If so, you could write some VBA:

1. Use the DDE method to read a certain tag from the PLC into excel
2. Rename the file with the contents of that tag you just read

If you don't have either of those things, it's still possible. You'll just need to find a way to read the value from your PLC with some other sort of scripting. I believe user dmroeder has a python script that can read/write CompactLogix tags. I'm sure python can rename files as well.

A third option might be AdvancedHMI. It's free and if you have a reasonable handle on VBA, quite powerful. I currently have a setup at home that uses a windows batch file to retrieve a weather forecast text file from the weather bureau every hour. Shortly afterward, my AdvancedHMI application calls up that file, extracts relevant figures, and writes them into a Click Koyo PLC. Later, it grabs values from the PLC and logs them to a text file. It's not that far removed from what you're doing - I'm not renaming files per se, but the VBA to write a PLC tag value into a specified file is not that different from the VBA to rename a specified file with the tag value from a PLC.

Any of those options take your fancy?
 
Since you already have FactoryTalk View ME running, I would recommend using the ME Program Launcher ActiveX to run an ordinary batch file.

The hard part is to be sure you've got an ME Display always open that can host the ActiveX object. I use my navigation bar for that purpose in most cases, but it's easier because on the PV+ I can place objects offscreen that are still on the Display.
 
Thanks!

I never used a batch file, but I know what it is. From a script in a batch file, it would be possible to get a tag value from a PLC? and then rename this a file with that that value?
Thanks again!
 
Thanks everyone!
I was able to do it with the ME Program Launcher.

ProgramLocation : "C:\BatchFile.bat"
ProgramParameter : "variable from the plc"
FocuseEnable:
LauchEnalbe : "variable from plc to lauch the bat file"


for my test my batch file was quite simple :

@echo off
rename C:\fileName.txt "%1".txt


Thats it!

Thanks again!
 

Similar Topics

Hi all, I am having an issue where some of my HMI push Buttons and Indicators go in to error when I navigate to a new screen. I am using a...
Replies
16
Views
308
We have a new machine that uses an armor block to transfer input signals for conveyor position that continuously alarms out on no position change...
Replies
0
Views
73
Hello everyone, I am trying to change the IP address of the Omron PLC (NJ30-1200) and HMI (NB7W-TW01B) to fetch the network on our network...
Replies
7
Views
256
Dear Experts, I'm just started working with GEO SCADA and I need your valuable help. Currently, I'm trying to edit the alarm limits on MIMIC...
Replies
0
Views
192
Hi, all! I have a 1768-L45 CompactLogix PLC with a couple of 4-20 temperature transmitters connected to it. I have the temperature scaling...
Replies
6
Views
443
Back
Top Bottom