Skip to main content
Solved

ZPL: OPEN / READ binary data

  • February 10, 2023
  • 6 replies
  • 305 views

Hans-Jürgen Feige

Hello community,
I am looking for an example of OPEN / READ / WRITE a binary file in ZPL.
Many Thanks!
Hans-Jürgen 

Best answer by David.Nguyen

Hi Hans-Jûrgen,

 

If you want my honest opinion, it isn’t worth it. Reading and writting binary files is a relatively basic task (at least if you know the syntax) in many other more general programming langages including C/C++, C#, MATLAB, Python. Many people, like myself, create our binary files with another langages, which also have a better integrated development environment (IDE). Therefore, I doubt there will be a huge incentive to have it in ZPL in the future. But you can still ask I guess.

Have you had a look at the code I sent you?

Take care,


David

View original
Did this topic help you find an answer to your question?

6 replies

David.Nguyen
Luminary
Forum|alt.badge.img+2
  • Luminary
  • 1085 replies
  • February 10, 2023

Hi Hans-Jûrgen,

 

I could be wrong but the Help File for OPEN reads:

Opens an existing text file for reading by the READ command.

 

This is only for text files, not binary files.

Also, I suggest writting binary files with MATLAB or Python. I wrote an example for Sources here in Python.

I hope this helps. Take care,

 

David

 


Hans-Jürgen Feige

Hi David,

thanks!

I was in the wrong help section (Tolerancing ) and found OPEN FILE filename mode (mode = [txt,bin]).

That’s pity.

Is it worth to be a support request?

Best Regards

Hans-Jürgen


David.Nguyen
Luminary
Forum|alt.badge.img+2
  • Luminary
  • 1085 replies
  • Answer
  • February 10, 2023

Hi Hans-Jûrgen,

 

If you want my honest opinion, it isn’t worth it. Reading and writting binary files is a relatively basic task (at least if you know the syntax) in many other more general programming langages including C/C++, C#, MATLAB, Python. Many people, like myself, create our binary files with another langages, which also have a better integrated development environment (IDE). Therefore, I doubt there will be a huge incentive to have it in ZPL in the future. But you can still ask I guess.

Have you had a look at the code I sent you?

Take care,


David


Hans-Jürgen Feige

Hi David,

thanks for the honest answer.
My problem is to replace missing MODIFYSETTING myself by manipulating the cfg files.
I might as well outsource that if I could launch a program (.exe) from ZPL (?).

Grüße

Hans-Jürgen


David.Nguyen
Luminary
Forum|alt.badge.img+2
  • Luminary
  • 1085 replies
  • February 11, 2023

Hi Hans-Jürgen,

 

Could you use the ZOS-API instead? You’d already be in an environment where writing/reading binary files becomes possible. Running executables as well.

Take care,

 

David


Hans-Jürgen Feige

Hi David,

thanks. We know that extensions are more powerful.

ZPL is enough for many things. And I like to push the limits.

Ok, for this task / problem we will use ZOS-API.

Viele Grüße

Hans-Jürgen


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings