Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/publish-simple.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages

name: Publish Packages

on:
push:
branches: main

jobs:
publish-all:
runs-on: ubuntu-latest
strategy:
matrix:
packages: [src/systemInfo,src/taskView]
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: https://npm.pkg.github.com/
- uses: JS-DevTools/npm-publish@v2
id: publish
with:
token: ${{ secrets.GITHUB_TOKEN }}
registry: "https://npm.pkg.github.com"
package: ${{ matrix.packages }}
- if: ${{ steps.publish.outputs.type }}
run: echo "Version changed!"
6 changes: 5 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@ library "jenkinsLibrary@master"

buildPublishPipeline(
slackChannel: "sandbox-github"
)
asProjectRepo: "vartools",
asProjectPath: "example/AsProject",
skipLpmInstall: true,
librariesToExport: ['vartools']
)
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Var tools

Var tools are a set of tools for interface to B&R's PV system.

It has functions for looking up and setting variables
10 changes: 10 additions & 0 deletions example/AsProject/AsProject.apj
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version="4.12.4.107 SP" WorkingVersion="4.12"?>
<Project Description="Starter Automation Studio project." Version="1.00.0" Edition="Standard" EditionComment="Standard" xmlns="http://br-automation.co.at/AS/Project">
<Communication />
<ANSIC DefaultIncludes="true" />
<IEC ExtendedConstants="true" IecExtendedComments="true" KeywordsAsStructureMembers="false" NamingConventions="true" Pointers="true" Preprocessor="false" />
<Motion RestartAcoposParameter="true" RestartInitParameter="true" />
<Project StoreRuntimeInProject="false" />
<Variables DefaultInitValue="0" DefaultRetain="false" DefaultVolatile="true" />
</Project>
Empty file.
3 changes: 3 additions & 0 deletions example/AsProject/Logical/Global.var
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
VAR
gSimulation : BOOL;
END_VAR
11 changes: 11 additions & 0 deletions example/AsProject/Logical/Libraries/Loupe/Package.pkg
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio FileVersion="4.9"?>
<Package xmlns="http://br-automation.co.at/AS/Package">
<Objects>
<Object Type="Library" Language="Binary">omjson</Object>
<Object Type="Library" Language="Binary">stringext</Object>
<Object Type="Library" Language="Binary">databuffer</Object>
<Object Type="Library" Language="Binary">tcpcomm</Object>
<Object Type="Library" Language="Binary">bodyguard</Object>
</Objects>
</Package>
14 changes: 14 additions & 0 deletions example/AsProject/Logical/Libraries/Loupe/bodyguard/Binary.lby
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version='1.0' encoding='utf-8'?>
<Library xmlns="http://br-automation.co.at/AS/Library" Version="0.03.0" SubType="Binary">
<Files>
<File>VersionHistory.txt</File>
<File Description="Exported data types">Types.typ</File>
<File Description="Exported constants">Constants.var</File>
<File Description="Exported functions and function blocks">bodyGuard.fun</File>
</Files>
<Dependencies>
<Dependency ObjectName="AsGuard" />
<Dependency ObjectName="runtime" />
<Dependency ObjectName="AsIODiag" />
</Dependencies>
</Library>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
VAR CONSTANT

END_VAR
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
/* Automation Studio generated header file */
/* Do not edit ! */
/* bodyguard 0.03.0 */

#ifndef _BODYGUARD_
#define _BODYGUARD_
#ifdef __cplusplus
extern "C"
{
#endif
#ifndef _bodyguard_VERSION
#define _bodyguard_VERSION 0.03.0
#endif

#include <bur/plctypes.h>

#ifndef _BUR_PUBLIC
#define _BUR_PUBLIC
#endif
#ifdef _SG3
#include "AsGuard.h"
#include "AsIODiag.h"
#include "runtime.h"
#endif
#ifdef _SG4
#include "AsGuard.h"
#include "AsIODiag.h"
#include "runtime.h"
#endif
#ifdef _SGC
#include "AsGuard.h"
#include "AsIODiag.h"
#include "runtime.h"
#endif


/* Datatypes and datatypes of function blocks */
typedef struct tgProtect_int_FUB_typ
{ struct guardRegisterLicense registerLicense;
struct guardCheckLicense checkLicense;
} tgProtect_int_FUB_typ;

typedef struct tgProtect_internal_typ
{ struct tgProtect_int_FUB_typ FUB;
} tgProtect_internal_typ;

typedef struct tgProtect
{
/* VAR_INPUT (analog) */
unsigned long productCode;
plcstring orderNumber[256];
plcstring description[256];
plcdword reaction;
/* VAR_OUTPUT (analog) */
unsigned short status;
unsigned long availableLicenses;
unsigned long neededLicenses;
unsigned long licenseIdent;
/* VAR (analog) */
struct tgProtect_internal_typ internal;
/* VAR_INPUT (digital) */
plcbit allowSimulation;
/* VAR_OUTPUT (digital) */
plcbit licenseRegistered;
plcbit licenseOk;
} tgProtect_typ;



/* Prototyping of functions and function blocks */
_BUR_PUBLIC void tgProtect(struct tgProtect* inst);


#ifdef __cplusplus
};
#endif
#endif /* _BODYGUARD_ */

Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
/* Automation Studio generated header file */
/* Do not edit ! */
/* bodyguard 0.03.0 */

#ifndef _BODYGUARD_
#define _BODYGUARD_
#ifdef __cplusplus
extern "C"
{
#endif
#ifndef _bodyguard_VERSION
#define _bodyguard_VERSION 0.03.0
#endif

#include <bur/plctypes.h>

#ifndef _BUR_PUBLIC
#define _BUR_PUBLIC
#endif
#ifdef _SG3
#include "AsGuard.h"
#include "AsIODiag.h"
#include "runtime.h"
#endif
#ifdef _SG4
#include "AsGuard.h"
#include "AsIODiag.h"
#include "runtime.h"
#endif
#ifdef _SGC
#include "AsGuard.h"
#include "AsIODiag.h"
#include "runtime.h"
#endif


/* Datatypes and datatypes of function blocks */
typedef struct tgProtect_int_FUB_typ
{ struct guardRegisterLicense registerLicense;
struct guardCheckLicense checkLicense;
} tgProtect_int_FUB_typ;

typedef struct tgProtect_internal_typ
{ struct tgProtect_int_FUB_typ FUB;
} tgProtect_internal_typ;

typedef struct tgProtect
{
/* VAR_INPUT (analog) */
unsigned long productCode;
plcstring orderNumber[256];
plcstring description[256];
plcdword reaction;
/* VAR_OUTPUT (analog) */
unsigned short status;
unsigned long availableLicenses;
unsigned long neededLicenses;
unsigned long licenseIdent;
/* VAR (analog) */
struct tgProtect_internal_typ internal;
/* VAR_INPUT (digital) */
plcbit allowSimulation;
/* VAR_OUTPUT (digital) */
plcbit licenseRegistered;
plcbit licenseOk;
} tgProtect_typ;



/* Prototyping of functions and function blocks */
_BUR_PUBLIC void tgProtect(struct tgProtect* inst);


#ifdef __cplusplus
};
#endif
#endif /* _BODYGUARD_ */

Expand Down
Binary file not shown.
10 changes: 10 additions & 0 deletions example/AsProject/Logical/Libraries/Loupe/bodyguard/Types.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

TYPE
tgProtect_internal_typ : STRUCT
FUB : tgProtect_int_FUB_typ;
END_STRUCT;
tgProtect_int_FUB_typ : STRUCT
registerLicense : guardRegisterLicense;
checkLicense : guardCheckLicense;
END_STRUCT;
END_TYPE
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
0.3.0 - Change implementation of licenseOk to work with AR x4.2n.
0.2.0 - Add orderNumber and description. They make it to the logger.
0.1.0 - First version with tgProtect()
21 changes: 21 additions & 0 deletions example/AsProject/Logical/Libraries/Loupe/bodyguard/bodyGuard.fun
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

FUNCTION_BLOCK tgProtect
VAR_INPUT
productCode : UDINT;
orderNumber : STRING[255];
description : STRING[255];
reaction : DWORD;
allowSimulation : BOOL;
END_VAR
VAR_OUTPUT
status : UINT;
licenseRegistered : BOOL;
licenseOk : BOOL;
availableLicenses : UDINT;
neededLicenses : UDINT;
licenseIdent : UDINT;
END_VAR
VAR
internal : tgProtect_internal_typ;
END_VAR
END_FUNCTION_BLOCK
15 changes: 15 additions & 0 deletions example/AsProject/Logical/Libraries/Loupe/bodyguard/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "@loupeteam/bodyguard",
"version": "0.3.0",
"description": "Loupe's bodyguard library for Automation Runtime",
"homepage": "https://loupeteam.github.io/Sandbox/libraries/bodyguard.html",
"scripts": {},
"keywords": [],
"author": "Loupe",
"license": "Loupe Software License Agreement",
"repository": {
"type": "git",
"url": "https://github.com/loupeteam/bodyguard"
},
"dependencies": {}
}
12 changes: 12 additions & 0 deletions example/AsProject/Logical/Libraries/Loupe/databuffer/Binary.lby
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version='1.0' encoding='utf-8'?>
<Library xmlns="http://br-automation.co.at/AS/Library" Version="0.01.1" SubType="Binary">
<Files>
<File>RevisionHistory.txt</File>
<File Description="Exported data types">DataBuffer.typ</File>
<File Description="Exported constants">DataBuffer.var</File>
<File Description="Exported functions and function blocks">DataBuffer.fun</File>
</Files>
<Dependencies>
<Dependency ObjectName="sys_lib" />
</Dependencies>
</Library>
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
(********************************************************************
* COPYRIGHT --
********************************************************************
* Library: DataBuffer
* File: DataBuffer.fun
* Author: davidblackburn
* Created: June 23, 2014
********************************************************************
* Functions and function blocks of library DataBuffer
********************************************************************)

FUNCTION datbufClearBuffer : UINT (*Clear a data buffer*) (*$GROUP=User*)
VAR_INPUT
pBuffer : UDINT;
END_VAR
END_FUNCTION

FUNCTION datbufInitBuffer : UINT (*Initialize a data buffer*) (*$GROUP=User*)
VAR_INPUT
pBuffer : UDINT;
maxLength : UDINT;
END_VAR
END_FUNCTION

FUNCTION datbufAppendToBuffer : UINT (*Append data to a data buffer*) (*$GROUP=User*)
VAR_INPUT
pBuffer : UDINT;
pData : UDINT;
dataLength : UDINT;
END_VAR
END_FUNCTION
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
(********************************************************************
* COPYRIGHT --
********************************************************************
* Library: DataBuffer
* File: DataBuffer.typ
* Author: davidblackburn
* Created: June 23, 2014
********************************************************************
* Data types of library DataBuffer
********************************************************************)

TYPE
DATBUF_ERR_enum :
(
DATBUF_ERR_INVALIDINPUT := 50000,
DATBUF_ERR_MEMALLOC,
DATBUF_ERR_NOTINITIALIZED,
DATBUF_ERR_BUFFERFULL
);
datbufBuffer_typ : STRUCT
pData : UDINT;
currentLength : UDINT;
maxLength : UDINT;
END_STRUCT;
END_TYPE
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
(********************************************************************
* COPYRIGHT --
********************************************************************
* Library: DataBuffer
* File: DataBuffer.var
* Author: davidblackburn
* Created: June 23, 2014
********************************************************************
* Constants of library DataBuffer
********************************************************************)

VAR CONSTANT

END_VAR
Loading