|
|
Rank: Advanced Member Groups: Member
Joined: 1/11/2012 Posts: 45 Location: Belgium
|
Hello,
I'm a new user of PI so have several questions. I'm recently using the PI interface configuration Utility for installing an Universal File Loader. I want to read data from a serial port and store it in the PI server with the help of the UFL. First a test will be done with Virtual Machine before the actual transfer to the PI server is done. The data I want to store is something like: X01,110309,00:00:18,1800,50 a name, a date, a time, a random value, a random value
I followed the Universal File Loader manual and the ICU manual but still I can't figure out how to do it. In the PI interface configuration I do the following: Interface > New Windows Interface Instance from EXE I fill in the following browser executable in my case: C:\ProgramFiles\PIPC\InterFaces\PI_UFL.exe host PI-server: SRV-BE-DI-061 Path: SRV-BE-DI-061 Point source: UFL Interface ID: 1 Service ID: 1 Click add I change the scan frequency to 5 min without offset. I insert the following ini.file: [INTERFACE] PLUG-IN = serial.dll
[PLUG-IN] BITS = 8 COM = 4 COMDATA = "C:\Program Files\PIPC\Interfaces\PI_UFL\Examples\Logs\serial_data.dat" PARITY = NO SPEED = 9600 STOPBITS = 0
[SETTING] DEB = 4 MAXLOG = 10 MAXLOGSIZE = 20 MSGINERROR = "C:\Program Files\PIPC\Interfaces\PI_UFL\Logs\err001.txt" OUTPUT = "C:\Program Files\PIPC\Interfaces\PI_UFL\Logs\log001.log"
'-----------------------------------------------------------------
[Field] Field(1).Name = "TagName" TagName.Type = "String" Field(2).Name = "Value1" Value.Type = "String" Field(3).Type = "Value2" Value.Type = "String"
[MSG] MSG(1).NAME = "Serial" MSG(1).EPC = "String"
[Serial] Serial.FILTER = C1=="*"
TagName = ["(*),*,*,*,*"] Value1 = ["*,*,*,(*),*"] Value2 = ["*,*,*,*,(*)"]
StoreInPI(TagName,,NOW(),Value1,,) StoreInPI(TagName,,NOW(),Value2,,)
In services I added tcpip. My question is now what I do next to make the universal file loader working? How can I send the data to a virtual machine?
|
|
|
|
|
OSIsoft vCampus is a subscription-based, online offering that consists of providing everything people need to develop applications on the PI System. We invite you to take a "tour" of the OSIsoft Virtual Campus - also feel free to consult the FAQ or contact OSIsoft vCampus for more details.
|
|
|
Rank: Advanced Member
 Groups: Member
Joined: 4/7/2011 Posts: 137 Location: KZN, South Africa
|
It's been a while since I worked with PI-UFL with Serial plugin. Have you tried running the service interactively and looking and the content of the log & error file as stated in the ini file. You also have to make sure that the pi-trust on your pi VM is setup to allow connections from this interface.
|
|
|
Rank: Advanced Member Groups: Member
Joined: 1/11/2012 Posts: 45 Location: Belgium
|
Yes indeed I created a new trust connected to the interface in the PI system management tools. I have being changing my ini file and checked it in the UFLdesigner program added in PI ICU. So I can say that this is correct. My log file is saying that 0 data lines are read. I also get an error about failing to connect to the service control manager. I’m now trying to solve this problem. Maybe it has something to do with the trust.
|
|
|
Rank: Advanced Member
 Groups: Member
Joined: 4/7/2011 Posts: 137 Location: KZN, South Africa
|
Can you confirm that this file exist ("C:\Program Files\PIPC\Interfaces\PI_UFL\Examples\Logs\serial_data.dat") and that there is some data in this file, if you are getting ") data lines read then ther is either no data in this file or your x.FILTER is not passing data to be writen. Also set your DEB = 6, this will also give us an indication if the problem is with data retrieval of actual service issues.
|
|
|
Rank: Advanced Member Groups: Member
Joined: 1/11/2012 Posts: 45 Location: Belgium
|
No data is received in this file. I currently changed my ini file to the following:
[INTERFACE] PLUG-IN = serial.dll
[PLUG-IN] BITS = 8 COM = 4 COMDATA = "D:\UFL\Oefenfiles\test.log PARITY = NO SPEED = 9600 STOPBITS = 0
[SETTING] DEB = 4 MAXLOG = 10 MAXLOGSIZE = 20 MSGINERROR = "D:\UFL\Oefenfiles\err.txt" OUTPUT = "D:\UFL\Oefenfileslog.log"
'-----------------------------------------------------------------
[FIELD] FIELD(1).Name = "FIELD_1" FIELD(1).Type = "String" FIELD(2).Name = "FIELD_2" FIELD(2).Type = "DateTime" FIELD(2).FORMAT = "yyMMdd" FIELD(3).NAME = "FIELD_3" FIELD(3).Type = "Time" FIELD(3).FORMAT = "hh:mm:ss" FIELD(4).NAME = "FIELD_4" FIELD(4).TYPE = "string" FIELD(5).NAME = "FIELD_5" FIELD(5).TYPE = "String"
[MSG] MSG(1).NAME = "Serial" MSG(1).EPC = "String"
[Serial] Serial.FILTER = C1=="*"
FIELD_1 = ["(*),*,*,*,*"] FIELD_2 = ["*,(*),*,*,*"] FIELD_3 = ["*,*,(*),*,*"] FIELD_2 = FIELD_2 + FIELD_3 FIELD_4 = ["*,*,*,(*),*"] FIELD_5 = ["*,*,*,*,(*)"]
StoreInPI(FIELD_1&"_S001",,FIELD_2,FIELD_4,,) StoreInPI(FIELD_1&"_S002",,FIELD_2,FIELD_5,,)
I also constantly get an error like: Error -2147200891: Failed to connect to the Service Control Manger. The operation completed succesfully. (OpenSCManger) (Connect to SMC) (GetDependentServices). from function StopService()
And
Error -214720089: Call to StartService failed. An instance of the service is already running. (StartService) (2) (StartAService) in function StartAService: Service PI_UFL failed to start
Any idea about solving these errors?
I tried re-installing UFL and SMT but nothing helps.
Thanks for the help.
|
|
|
Rank: Advanced Member
 Groups: Member
Joined: 4/7/2011 Posts: 137 Location: KZN, South Africa
|
1.Try adding bufserv as a depending service. Tools->Buffering 2.Set DEB=6 and post the results of the log and error file, just remove the obvious sensitive stuff. 3.Also try to run the service interactively and post the result of the pipc.log file 4.I see you are using COM=4, are you using Comport no 4 for the serial data transfer 5.If there is no data in the test.log file then the problem is something else.
Good luck and don't give up, try try and try some more, read read and then you read some more, the only why we learn is by struggeling
|
|
|
Rank: Advanced Member Groups: Member
Joined: 1/11/2012 Posts: 45 Location: Belgium
|
The last time I could get it started this morning I got this log.file: (my error file is empty) For this I set the DEB to 6
Scheduler PI UFL Scheduler is starting... Scheduler PI UFL Scheduler started. Begin reading PI point updates. End reading PI point updates. Begin scan. PL_GetBufferedData() 0 data lines read. End scan. Begin updating PI Health Tags. End updating PI Health Tags. Begin updating PI PERF.Cntr. Write to PERF.Cntr : Points Good : time = 13-Jan-12 09:07:15, value = 0. Write to PERF.Cntr : Point Count : time = 13-Jan-12 09:07:15, value = 9. Write to PERF.Cntr : Interface up-time (seconds) : time = 13-Jan-12 09:07:15, value = 1. Write to PERF.Cntr : Device Scan Time (milliseconds) : time = 13-Jan-12 09:07:15, value = 0. Write to PERF.Cntr : Scan Time (milliseconds) : time = 13-Jan-12 09:07:15, value = 0. Write to PERF.Cntr : Scheduled Scans: % Missed : time = 13-Jan-12 09:07:15, value = 0. Write to PERF.Cntr : Scheduled Scans: % Skipped : time = 13-Jan-12 09:07:15, value = 0. Write to PERF.Cntr : Scheduled Scans: Scan count this interval : time = 13-Jan-12 09:07:15, value = 1. Write to PERF.Cntr : Log file message count : time = 13-Jan-12 09:07:15, value = 57. Write to PERF.Cntr : Points edited in the interface : time = 13-Jan-12 09:07:15, value = 0. Write to PERF.Cntr : Points added to the interface : time = 13-Jan-12 09:07:15, value = 0. Write to PERF.Cntr : Points removed from the interface : time = 13-Jan-12 09:07:15, value = 0. Write to PERF.Cntr : Points In Error : time = 13-Jan-12 09:07:15, value = 0. Write to PERF.Cntr : Points Stale 10(min) : time = 13-Jan-12 09:07:15, value = 0. Write to PERF.Cntr : Points Stale 30(min) : time = 13-Jan-12 09:07:15, value = 0. Write to PERF.Cntr : Points Stale 60(min) : time = 13-Jan-12 09:07:15, value = 0. Write to PERF.Cntr : Points Stale 240(min) : time = 13-Jan-12 09:07:15, value = 0. Write to PERF.Cntr : Device Status : time = 13-Jan-12 09:07:15, value = 0. Write to PERF.Cntr : PI Status : time = 13-Jan-12 09:07:15, value = 0. Write to PERF.Cntr : Device Expected Connections : time = 13-Jan-12 09:07:15, value = 1. Device Actual Connections : time = 13-Jan-12 09:07:15, value = 1. End updating PI PERF.Cntr. Begin reading PI point updates. End reading PI point updates.
I tried to enable the buffer in tools and I added the bufferserv in services; then I got this in my pipc.log file:
PI_UFL.exe> Output is redirected to: D:\UFL\Oefenfiles\log.txt PI_UFL.exe>PI-API (5080) - SRV-BE-DI-061> APIBUFFER: Unable to open primary shared memory buffer. PI_UFL.exe>PI-API (5080) - SRV-BE-DI-061> APIBUFFER: Unable to open shared memory buffers.Buffer server may not be running. PI_UFL.exe>PI-API> Initial connection to [srv-be-di-061:5450][1]
I’m 100% sure that my data is coming in Comport 4, because I have a little program for control the reading of data through Comports called Virtual Serial Ports Emulator. I still got the error about failing to connect to the service control manger. Do you know what the reason could be for this problem
Thanks again for the help until now.
|
|
|
Rank: Advanced Member
 Groups: Member
Joined: 4/7/2011 Posts: 137 Location: KZN, South Africa
|
Try using pibufss, try running the service interactively (Ctrl+T or Interface>Start Interactively), can you post the data from the serial port, it seems that there is no data hence the (0)data lines read. Also check the log file on the server for any error messages, even if we know you can connect ***Initial connection to [srv-be-di-061:5450][1]***
|
|
|
Rank: Advanced Member Groups: Member
Joined: 1/11/2012 Posts: 45 Location: Belgium
|
With the pibufss a startToService failure appears So excluded that back again. The log file on the server gives an error: API buffer: Unable to open shared memory buffers. Buffer server may not be running.
Also when I click to start interactively the service starts running and then I get a warning for that.
When I play around in tools > buffering I again get the failed to connect to service manager error. Now I have been looking around to encounter this and found out on the Osisoft website that they don't have a direct answer to it.
I'm stilling looking around going from error to error.
The thing is with the com ports, I let a text file being send to com port 2 and this com port sends information back again to com port 4 which I use for the interface. I do this with a serial ports simulation program. This needs to simulate that information is send abroad by a com port and received at the com port at our office at which the data can be collected for calculation purposes. This is done for testing. So we also made some dummy tags for writing this information to. The text file I made consists information like: X01,010112,00:00:01,10,1800 X01,010112,00:00:02,10,1800 X01,010112,00:00:03,10,1800 (a tag name,a date, a time and 2 values) and it goes on like this
|
|
|
Rank: Advanced Member
 Groups: Member
Joined: 4/7/2011 Posts: 137 Location: KZN, South Africa
|
I think this will solve your problems with buffer connection to the PI server, look at points 7-15. There is also an issue regarding the account under which buffering is running see here for more detail from OSITech Support. Keep us updated.
|
|
|
Rank: Advanced Member Groups: Member
Joined: 1/11/2012 Posts: 45 Location: Belgium
|
Yes indeed this solved the problem. I also had the problem that the serial simulation program didn't worked instead I used com0com. So that is an advice for other users for serial simulation to use online free program com0com. Now I still have the problem that no data is written to the tags, that has the do with the trusts (for writing) because the same worked with my colleague. So that will work out.
Thanks for all the help, it was really helpfull.
I also have a question about PI2010 system but I will be posting this under another topic.
|
|
|
Rank: Advanced Member Groups: Member
Joined: 1/11/2012 Posts: 45 Location: Belgium
|
Hello again,
I'm now converting lots of data with my universal file loader. Therefore I wrote a long ini file. When I run this interactively I got the message in my log files that at a certain moment (at tag 32 of 301) that a string can not be converted anymore. Part of the log file is then: 24-Jan-2012 15:34:01 [PI_UFL] [Info] Write to PI : H037_S032 : time = 16-Oct-2011 06:32:00, value = A, status = , flags = . 24-Jan-2012 15:34:01 [PI_UFL] [Line 1134] [StoreInPI] Cannot convert A from String to R8. 24-Jan-2012 15:34:02 [PI_UFL] [Info] [Line 1 ] H037,...... Write to PI : H037_S001 : time = 16-Oct-2011 06:32:00, value = H037, status = , flags = . 24-Jan-2012 15:34:02 [PI_UFL] [Info] Write to PI : H037_S002 : time = 16-Oct-2011 06:32:00, value = 0, status = , flags = . 24-Jan-2012 15:34:02 [PI_UFL] [Info] Write to PI : H037_S003 : time = 16-Oct-2011 06:32:00, value = 0, status = , flags = . 24-Jan-2012 15:34:02 [PI_UFL] [Info] Write to PI : H037_S001 : time = 16-Oct-2011 06:32:00, value = H037, status = , flags = .
After this the coming information (to the other 269 tags) is not written to PI, this keeps repeating itself. Does someone know how to tackle this problem?
We are also working with a buffer. This is set in tools > buffering > PI buffer subsystem. A trust for this is made in the system management tool for this buffer system. Under the PI buffer subsystem service we log in with a computer name which has a trust. (we have a trust for the buffer for each computer user) If we run the UFL with a computer then another person with a another computer can not use the bufferservice anymore, is this because only one computer can use the UFL with bufferservice? How can we solve this if we have several computers that need to use the universal file loader.
|
|
|
Rank: Advanced Member
 Groups: Member
Joined: 4/7/2011 Posts: 137 Location: KZN, South Africa
|
Hi arnow, I'm happy to hear that things are going well regarding the UFL interface.
TAGNAME:H037_S032 is it configured as a String or float32,int32? Was this previously created and then later renamed, meaning was it originally created to receive float values and you reconfigured it later to receive string values.
|
|
|
Rank: Advanced Member Groups: Member
Joined: 1/11/2012 Posts: 45 Location: Belgium
|
Yes thanks squatty. You solved the problem again.
My UFL is now properly working on my computer. Now I have to test the ufl on a virtual machine. If I have any problems with that you will again be hearing from me.
Thanks again
|
|
|
Rank: Advanced Member Groups: Member
Joined: 1/11/2012 Posts: 45 Location: Belgium
|
Here I'm again with my UFL,
Now I'm trying to test my UFL on another virtual computer with the help of Remote Desktop Connection. I have a virtual desktop and I have a virtual server with a certain IP adres. I made a trust for this computer, I made a trust for the buffer (pibuffss.exe) which I need to use for this computer and I made a mapping for the virtual computer.
I start PI ICU in the virtual computer and first check the SDK connection (Interface > SDK connection), there I check the PI server box and under Network node I enter the IP adres of the virtual server which is made by the IT department. I check the port number and fill in a a username. I click save and PI asks for a PI server login. Whatever I try this doesn't work, even I fill in my own credentials which I already tested on my own computer, this don't work. Therefore I just simply fill in piadmin and this works.
Then I do "new windows interface from exe", I select the UFL.exe file, I check the server and under Path I got the IP adres of my virtual server. I choose the point source and so on. Without the buffer I don't get my data read, also I got some problems with setting the buffer. I disabled the buffer on my own computer, because we can only use one buffer in total and I check the PI buffer box (tools > buffering). I then look in PI buffer subsystem service. There I fill in the username and pasword of the virtual computer and I get a pasword/username disagreement. Therefore I tested this with my own username and pasword, because I know that this worked on my own computer, but this also didn't worked.
So to recapitulate I don't know exactly how to set the virtual server on my virtual computer, I'm not able to read data and I'm not able to set the buffer on the virtual computer. Please help.
|
|
|
Rank: Advanced Member
 Groups: Member
Joined: 4/7/2011 Posts: 137 Location: KZN, South Africa
|
Try using a netmask of 255.255.255.255 in your trust. You don't have to create a trust for the pibufss as all connections from the trusted source would be treated as such. Can you do an APISNAP to your PI SERVER
Just clarify some questions your current setup is as follows UFL SOURCE->INTERFACE(VM)->PI SERVER(VM)
|
|
|
Rank: Advanced Member Groups: Member
Joined: 1/11/2012 Posts: 45 Location: Belgium
|
I tried the netmask of 255.255.255.555 this didn't work. The netmask of the virtual computer is 255.255.255.0. I don't know if this matter.
My set up is exactly as you describe it UFL source (in my case serial) > UFL (on virtual machine) > PI server (virtual server). I tried the API PI server this also doesn't work. The problem with reading the data I figured out is because of problems with the serial com port, now I'm figuring out this problem.
Thanks for the help.
|
|
|
Rank: Advanced Member
 Groups: Member
Joined: 4/7/2011 Posts: 137 Location: KZN, South Africa
|
Is the VM(Client) and VM(Server) on the same physical PC?
|
|
|
Rank: Advanced Member Groups: Member
Joined: 1/11/2012 Posts: 45 Location: Belgium
|
No the VM(client) and VM(server) are not on the same computer.
|
|
|
Rank: Advanced Member Groups: Member
Joined: 1/11/2012 Posts: 45 Location: Belgium
|
In real life the client and server will not be on the same physical computer. But this is the testphase in which simulate the client-server with a program called COM0COM for sending and receiving log files with data. I mean this COM0COM program is now not working properly, why I can't receive data in through the UFL of my virtual machine.
|
|
|
|
Guest
|