FactoryTalk View ME 5.0 Parameter Files

olsonsr

Member
Join Date
Mar 2008
Location
Indianapolis
Posts
3
I am stumped about how to accomplish dynamic parameter file operations. Maybe it is not possible, but it would very helpful in global object usage. Issue described as follows:

I have a global object defined (a valve) that has all the features and functions I would like all 50-60 valves I will be encountering. The valve animations work, text replacement using the object parameter (#1, #2 etc). However, I am unable to get a Goto Display object INSIDE the global object to have a passable parameter file name. For example, This one Goto Display object would want to go to the display 'VLV' (which works) and pass along parameter file 'CH001A' (which exists).

This valve object was originally not a global, and the paramter files and subsequent pop-up screen worked flawlessly. When I 'encapsulate' the valve as a global object, the parameter file option does not appear to be 'chanegable'. So when I replicate it 50 times all valve will display the correct information, but all 50 will popup the valve screen for CH001A. If I attampt any /LS:0 #1/ or other dynamic settings for the global valve object, it does not resolve during runtime.

Is this just not possible, or am I missing a key point in how to set it up.

Base issue. I want a global object to be able to open a popup using a parameter file defined at the Reference level, not the global level.

Thanks in Advance for any help

-Scott
 
olsonsr said:
Is this just not possible, or am I missing a key point in how to set it up.

Base issue. I want a global object to be able to open a popup using a parameter file defined at the Reference level, not the global level.
-Scott

Let's see if I got this right; You have a global object that has a parameter file passed to it. From this global object you are trying to open another display or faceplate called "VLV" and pass parameters to that display.

I haven't made the jump to FTView 5.0 ME but I tried something simlar with RSView 4.0 ME and I could not do it.

The end customer had stringent HMI specs, and the OEM had decided to go with a PVPlus terminal running ME. The end user's specs basically called out for opening additional faceplates from inside faceplates.

I ended up convincing the OEM to go with RSView SE and using a Versa View. SE has "Touch" animation and the ability to pass parameters from one faceplate to another.

Here's the link to my original question to the group:

http://www.plctalk.net/qanda/showthread.php?t=34012

If the FTView 5.0 ME has "Touch" animation, that may be a route to go.
 
ok... I can't find anything else exactly like I'm looking for, so I'll try extending this thread.

Probably not really a hyjack since it it two years old. haha.

I'm using Factorytalk view me version 6 on a project with a ControlLogix plc. I've completed the PLC portion and I have 208 motors in the project. I have a UDT for the motor data that is stored in an array tag M. For example I have M[1], m[2], M[3]...M[208]. Each of the motors has several data points like M[1].startPB, .stopPB etc.

I'd like to create one page on the Panelview Plus that has all the motor data displayed. I'm trying to find a way to indirectly address each of the UDT tags.

I found that there is a parameters file that can be generated, and that would allow me to write a file where #1=M[1] . Then on the panelview screen I can have all the data created as #1.startPB, #1.stopPB etc. The problem with this is that now I have to create 208 parameter files with just one line each (all pointing to #1 from each of the M[n] motors). There has to be an easier way??? Right???

Is there a way to have a variable where I can change "n" and then call the single parameter file with an indirect value for the motor number?

What about condition statements in the parameter file....is this allowed? if n=1 then #1=M[1] else if n=2 then #1=M[2].....

Thanks,
Michael
 
Last edited:
do you have an example to point to? Where would I use the VB? Are you talking about a macro or a VBscript? I could see how either might work, but I'd like to follow an example if available, or if you can be more specific about how to implement this logic in the panelview application.

Thanks,
Michael
 
you could back door the file entry

The parameter file is just a text file located in the ...\project\PAR directory
Use an Excel macro to create the *.par files in some other folder

then right click parameters -> add new component to application
(note do Not manually add the PAR file to PAR directory you will stuff up the internal RS view database)

Also the graphics pages can be exported to xml and modified - Use this is if you want to create the 208 buttons that call the correct page with the correct parameter file
 
you could back door the file entry

The parameter file is just a text file located in the ...\project\PAR directory
Use an Excel macro to create the *.par files in some other folder

That is a good idea. Hovever when I try it, the text file looks just like the one that is already in the \PAR directory when opening with wordpad or notepad, but when imported into the project, the file is jibberish. Is there a trick to the file format in the macro? Are there some hidden characters I need to put into the file as I generate it?
 
hmm
worked for me in ME Version 5.10 without a problem
Used notepad to create a new file saved as test.PAR encoding = unicode (all files) Win XP SP3

Another method if you are a script or VBA programmer - look at AutoHotKey http://www.autohotkey.com/ - Captures keystrokes mouse movements etc and you can program it - Allows you to drive the ME interface directly under program control
 
Last edited:
The problem you're having with the parameter file showing you giberish once you open it up in FTView is that the file is created as an ASCII file, you need to create it as Unicode, to do this on VBA simply set the last parameter of the "CreateTextFile" object to TRUE, i.e.:

Set File = fs.CreateTextFile("c:\testfile.txt", True, True) where:

object.CreateTextFile(filename[, overwrite[, unicode]])

object Required. Always the name of a FileSystemObject or Folder object.

filename Required. String expression that identifies the file to create.
overwrite Optional. Boolean value that indicates if an existing file can be overwritten. The value is True if the file can be overwritten; False if it can't be overwritten. If omitted, existing files are not overwritten.

unicode Optional. Boolean value that indicates whether the file is created as a Unicode or ASCII file. The value is True if the file is created as a Unicode file; False if it's created as an ASCII file. If omitted, an ASCII file is assumed.
 
How can you do this when ME doesn't support VBA?

Thanks!

The problem you're having with the parameter file showing you giberish once you open it up in FTView is that the file is created as an ASCII file, you need to create it as Unicode, to do this on VBA simply set t
 
Encoding Problems While Using Excel VBA to make FactoryTalk Parameter Files

I apologize in advance for posting on an old thread, but I feel like I should share this info so others need not endure more anguish. SPOILER ALERT! This is a bit lengthy but hopefully helpful. I digress..

I happened upon this thread because I was trying to create parameter files with Excel VBA (we all know how fast and easy it is to make 100 parameter files in FTView)...

The macro created my .PAR files fine, they looked the same in Notepad++ as ones created in FTView, but once I opened them in FTView they looked like gibberish. Or a Chinese newspaper, still not sure on that one.

That's when I saw in Notepad++ that the macro wasn't encoding my files correctly. My first attempt was to have my macro save the files in xlUnicodeText format. This made them display in FTView but stall out with a syntax error on creating the runtime application.

What followed was a 3-day intensive research initiative into the hell of Unicode and text encoding. I will omit details to spare the reader's sanity.

Needless to say, the core of my issue was this. Excel Unicode encodes in UTF-16LE BOM (Little Endian with Byte Order Mark). FTView encodes .PAR files with UTF-16LE....without a BOM. The BOM was throwing off FTView because the first two bytes it saw were the BOM, which it wasn't expecting.

The macro was modified to create an encoding stream and spit out the text after stripping the BOM off the front and voila! The parameter files are in UTF-16LE without a BOM and FTView is happy.

So basically it all boils down to the fact that Microsoft is doing the moral thing and telling the world it's using little endian by providing the BOM and Rockwell is saying screw all y'all, we could care less if you knew what our byte order was, we're saving 2 bytes!!!

I've attached a spreadsheet for all to use (much help from people over on stack overflow). You may have to tweak it to make it work for you, but I hope this helps anyone trying to use VBA in Excel to quickly create lots of .PAR files for FTView.

To make it work in a few easy steps:
1. Change the file from .xlsx to .xlsm.
2. Change the file path in cell 'A2' to wherever you want the files to go.
3. Add the Microsoft ActiveX Data Objects 2.5 Library (Tools --> References).
4. Add this code to sheet 1.

Code:
Private Sub CommandButton1_Click()

    Call WorksheetLoop 'UserForm1.Show

End Sub

5. Add this code to a macro. That's it!

Code:
'This subroutine will loop through all worksheets in a workbook.
'For each worksheet, the sub will loop through all cells in a specified column range.
'Each cell in that range will be copied to an encoding stream in UTF-16LE format.
'The compiled stream will be saved as a parameter file for use in RSView Studio.
'The parameter file will have had the BOM removed due to incompatibility of the BOM with FTView.
'-------------------------------------
Sub WorksheetLoop()

    'Dim variables for subroutine.
    Dim wB As Workbook
    Dim wBSheets As Range
    Dim wS As Worksheet
    Dim wSCell As Range
    Dim wSCellRange As Range
    Dim lastRow As Long
    Dim fileName As String
    Dim filePath As String
    
    'Sets active workbook and preps for cycling through day values.
    Set wB = Application.ActiveWorkbook
    filePath = wB.Worksheets(1).Cells(2, 1)
    
    'Loop through all worksheets in workbook.
    For Each wS In wB.Worksheets
      
        'Identify last row in column with data.
        wS.Activate
        fileName = wS.Cells(1, 1)
        lastRow = wS.Range("F2").CurrentRegion.Rows.Count
        
        'Create range for cell loop.
        Set wSCellRange = wS.Range("F2:F" & lastRow)

        'Dimension and create encoding stream.
        Dim UTFStream As Object
        Set UTFStream = CreateObject("adodb.stream")
        UTFStream.Type = adTypeText
        UTFStream.Mode = adModeReadWrite
        UTFStream.Charset = "UTF-16LE"
        UTFStream.LineSeparator = adCRLF
        UTFStream.Open
        
        'Loop through cell values in range and write as text with line seperator to stream.
        For Each wSCell In wSCellRange
            UTFStream.WriteText wSCell, 1
        Next wSCell
    
        'Modify stream to skip UTF-16 Little Endian Byte Order Mark (BOM).
        UTFStream.Position = 2
    
        'Dimension and create binary stream.
        Dim BinaryStream As Object
        Set BinaryStream = CreateObject("adodb.stream")
        BinaryStream.Type = adTypeBinary
        BinaryStream.Mode = adModeReadWrite
        BinaryStream.Open
    
        'Copy encoding stream to binary stream, having previously stripped BOM (first 2 bytes).
        UTFStream.CopyTo BinaryStream
        
        '--------------------
        'Uncommenting the below SaveToFile line will write the encoding stream w/ BOM to a text file.
        'This will show that the BOM has been removed by comparing encodings of the encoding and binary result.
        'Encodings can be compared using software such as Notepad++.
        'UTFStream.SaveToFile "C:\Users\ - Insert Your Username Here - \Desktop\UTFstream.txt", adSaveCreateOverWrite
        '--------------------
        
        'Clear encoding stream for next worksheet.
        UTFStream.Flush
        UTFStream.Close
    
        'Save binary stream to parameter file, using cell values to determine file name and path.
        BinaryStream.SaveToFile filePath & "\" & fileName & ".par", adSaveCreateOverWrite
        BinaryStream.Flush
        BinaryStream.Close
      
    'Run next worksheet.
    Next wS
    
    'Reset active sheet to first worksheet.
    wB.Worksheets(1).Activate
    
End Sub

Admins - if this post should be moved, please feel free to do so, I apologize for any transgression.
 

Similar Topics

Hi All, I'm currently designing a faceplate for an analog input object, and I'm trying to create an alarm tab with an Alarm and Event Summary...
Replies
1
Views
439
I will try to explain what I am doing. I have 6 fillers, all of them the same, all of them have 8 heads on each filler. I press a GoTo screen...
Replies
4
Views
1,163
Hey everyone, I want to make a faceplate in FactoryTalk View Studio and use parameters. Is there a way to provide feedback as to what file...
Replies
2
Views
2,553
Hi guys, A dumb question, but is it possible to pass values to tags using parameter files in Ftview SE ver 11? TIA
Replies
2
Views
1,451
I am using a Global Object Touch animation to open up a popup window. Can you use one of the Parameters you pass though to adjust the visibility...
Replies
1
Views
3,169
Back
Top Bottom