B&R automation studio: FileIO

nickygriff

Member
Join Date
Sep 2014
Location
Hampshire
Posts
3
Hi guys,

Just started using PLCs last week. I'm trying to create an example file which will save an integer on one of the usb sticks or the laptop connected via RJ45.

The FileIO FBs all have a Pointer to device name. Where do I find the device name?

Thanks
 
Hello,

I don't know which AR version is in use, find enclosed valid for AR 3.xx and 4.xx.


The device name you will get from function block DevLink which you have to use in both cases USB and Ethernet.

When you look to the help on Location ID 3.15.15.7.3.28 so there is description of DevLink function block. This function block has these parameters

I/O
Parameter
Data type
Description
IN
pDevice
UDINT
(given as a pointer to STRING)
Enables the function block (FB)

Pointer to the device name. Name of file device. It can be used by the other FBKs after a successful linking (e.g. FileCreate, etc).

Device names are case sensitive.


You can see that there is pDevice parameter so you will add some name it's up to you and this name you will use for other function blocks from FileIO library.

So the notation in Stucture Text will looks like e.g.

DevLink.pDevice := ADR('myDisk');

Device name is myDisk in this case.

So when you will call another function block e.g. FileCreate

I/O
Parameter
Data type
Description
IN
pDevice
UDINT
(given as a pointer to STRING)
Enables the function block (FB)

Pointer to the device name. Points to the name of an existing file device (e.g. “HD0”) that was created with AS or the DevLink FBK.

Device names are case sensitive.


so you will use as device name myDisk. So the notation in ST will looks like:

FileCreate.pDevice := ADR('myDisk');

If there are still open points you can contact the responsible B&R office in your near - for sure they are happy to help you.
 
Unfortunately I can't include a table here. but you have to read it like that:

I/O: IN
Parameter: pDevice
Data type: UDINT (given as a pointer to STRING)
Description:
Enables the function block (FB)

Pointer to the device name. Name of file device. It can be used by the other FBKs after a successful linking (e.g. FileCreate, etc).

Device names are case sensitive.
 
HI,
I am using automation studio version4.3.

I want to save datalogging(csv files) from PLC (x20) to USB with help of*FileIO.
*
I used AsUSB library first and*I used *(example, LibAsUSB1_ST) program to get path of USB and*I get the system the path / bd0.

(* Program
*CREATE_FILE_DEVICE:* (*Library FileIO - Functionblock DevLink() - create file out of data just from 1. USB*)
******
**strcpy(ADR(device_name), ADR('DEVICE_USB'));* (*fixed Device-Name get copied to device_name-Variable*)***************
**strcpy(ADR(device_param), ADR('/DEVICE='));* (*first part of parameter get copied to device_param-Variable*)**
**strcat(ADR(device_param), ADR(usb_data_buffer[0].ifName));* (*second part get added to device_param-Variable*) ****************************
*
**DevLink_0.enable := 1;
**DevLink_0.pDevice := ADR(device_name);* (*Devicename is assigned*)
**DevLink_0.pParam := ADR(device_param);* (*the path of the Device is assigned*)
**DevLink_0;

*)

then*I used the*whole program ( example, LibFileIO1_ST) but*I don't know how i can save my data logging file into USB.*I tried to use FileCopy for that but I don't know what should I write in destination name, source name and new file, file name?

In configutation view my datalogging file will be save in c:\

setting for data logging
configutation view->File devices->File device1->name:Datanspeicher and path:c:\

program of FileCopy
*50: (* copy a file program**)
*(**
***Handling.Functionblock.FileCopy_0.enable := 1;
***Handling.Functionblock.FileCopy_0.option := fiOVERWRITE;* (* overwrite existing file *)
***Handling.Functionblock.FileCopy_0.pSrcDev := ADR(?);* (* name of a linked device *)
***Handling.Functionblock.FileCopy_0.pSrc := ADR(?);* (* name of the source file *)
***Handling.Functionblock.FileCopy_0.pDestDev := ADR(?);* (* name of a linked device *)
***Handling.Functionblock.FileCopy_0.pDest := ADR(?);* (* name of the new file*)
***Handling.Functionblock.FileCopy_0;* (* call the function*)
**)


so what should I write into the pSrcDev, pSrc, pDestDest, pDest?

or if i am wrong then what is the right way.
 

Similar Topics

Hi, I have been trying to run drive via Sysmac studio. I can ping the drive. I can see the logic bits going on/off as per command. But, drive is...
Replies
21
Views
549
Hello Experts, I recently stumbled with an issue about ABB VFD ACS800 connected with B&R PLC X20CP1484-1. This ABB VFD ACS800 somehow got...
Replies
0
Views
315
Hi, I would like to prepare a project for the operator panel and I do it like this: New project -> I choose the appropriate panel -> add object ->...
Replies
0
Views
420
Hi, I would like to prepare a project for the operator panel and I do it like this: New project -> I choose the appropriate panel, it seems to me...
Replies
3
Views
625
Hi all, I am working with an IO link sensor (measuring current across motor)and need to read in and store the sensor values for 5 seconds, then...
Replies
13
Views
1,200
Back
Top Bottom