Skip to content

Bikeprincess/BnR-JSONer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JSONer Zpět

Made For B&R

JSONer library for serialize and deserialize JSON for B&R PLC.

Usage

There are 2 Function for user:

  • JSON_serialize: create JSON string from variable
    • pVarName: PV name with program name, if it's not global var.
    • pUserVarName: ADR of string with variable name - only used with array.
    • pOut: ADR of buffer.
    • sizeOut: size of output buffer.
    • size: IN/OUT variable for check output size.
  • JSON_deserialize: parse JSON string into PV
    • pVarName: PV name with program name, if it's not global var.
    • pUserVarName: ADR of string with variable name - only used with array. Internally <> 0 and name is not used. Set to 0, if PV is STRUCT.
    • pIn: ADR of JSON string.
    • sizeIn: size of input string - for internal check.

Output is ENUM JSONer_Status_e: JSONer_Ok is 0 and another states are Errors.

Just call the function to generate values.

Limitation / Known bugs

  • Array must start with index 0 and be positive. Dimension can be only one.
  • ENUMS not supported. Use UDINT.
  • WSTRING is not implemented, but have place in program.
  • Input STRING are not modified, only copied to output. That's mean, that $n are not transfered to \n etc.
  • Speed and memory usage?

Changelog

V1.0.1

  • FIX numeric handling
  • Remove whitespaces form serializer

V1.0.1

  • FIX bool -> Remove Quoation and do small alphabet
  • Fix input array

V1.0.0

First usable version

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published