ATTENTION

This FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at https://answers.flexsim.com/. Our new Question & Answer site brings a modern, mobile-friendly interface and more focus on getting answers quickly. There are a few differences between how our new Q&A community works vs. a classic, threaded-conversation-style forum like the one below, so be sure to read our Answers Best Practices.


flexsim.com

Go Back   FlexSim Community Forum > FlexSim Software > Q&A
Downloads

Q&A Using Flexsim and building models

  #1  
Old 04-10-2008
Nico Zahn's Avatar
Nico Zahn Nico Zahn is offline
Flexsim User
 
Join Date: Sep 2007
Location: Bingen am Rhein, Germany
Posts: 179
Downloads: 19
Uploads: 4
Thanks: 66
Thanked 60 Times in 32 Posts
Rep Power: 201
Nico Zahn has a spectacular aura aboutNico Zahn has a spectacular aura about
Default Priniting to a device

Hi,
I have to print to a printer or other device from flexsim.
I need to print it with a special font-type so the string I print comes out as a barcode.
Any ideas?
__________________
kind regards Nico.
  #2  
Old 04-11-2008
Brenton King's Avatar
Brenton King Brenton King is offline
Flexsim Technical Support
 
Join Date: Jul 2007
Posts: 44
Downloads: 60
Uploads: 5
Thanks: 10
Thanked 41 Times in 15 Posts
Rep Power: 271
Brenton King is a name known to allBrenton King is a name known to allBrenton King is a name known to allBrenton King is a name known to allBrenton King is a name known to allBrenton King is a name known to all
Default

I'm guessing that this is something that you are wanting to do automatically from Flexsim and that copy paste methods don't apply here?
  #3  
Old 04-14-2008
Nico Zahn's Avatar
Nico Zahn Nico Zahn is offline
Flexsim User
 
Join Date: Sep 2007
Location: Bingen am Rhein, Germany
Posts: 179
Downloads: 19
Uploads: 4
Thanks: 66
Thanked 60 Times in 32 Posts
Rep Power: 201
Nico Zahn has a spectacular aura aboutNico Zahn has a spectacular aura about
Default

Hi Brenton,
yes that is correct. I found a tool for creating barcodes (shareware, 260$) called active barcode. It can be commandline driven, so i think I could use the 'runprogram' command to call the program and then use the 'runprogram' command again with parameters to let the program create the barcode.

If I understood the 'runprogram' command right, I can put in anything I could also execute in the Windows cmd?
__________________
kind regards Nico.
  #4  
Old 04-14-2008
Nico Zahn's Avatar
Nico Zahn Nico Zahn is offline
Flexsim User
 
Join Date: Sep 2007
Location: Bingen am Rhein, Germany
Posts: 179
Downloads: 19
Uploads: 4
Thanks: 66
Thanked 60 Times in 32 Posts
Rep Power: 201
Nico Zahn has a spectacular aura aboutNico Zahn has a spectacular aura about
Default

So I tried the transfer from theory to real ...
I have two more questions :
1. How can I make the cmd shell not disapear direcly so I can read error messages ... (/k does not work ..)
2. How can I pass strings as parameters which have to be marked by "" ?

I am now trying to call the tool by a cscript C:\\path_to_application param1 param2 'param3' ....

it works in the cmd shell but from flexscript I see the shell, but it doesn´t create a output and the shell is disapearing to fast to read the error message...
__________________
kind regards Nico.
  #5  
Old 04-14-2008
Brandon Peterson's Avatar
Brandon Peterson Brandon Peterson is offline
The Flexsim Consultant
 
Join Date: Jul 2007
Location: Salt Lake City, Utah
Posts: 382
Downloads: 29
Uploads: 6
Thanks: 192
Thanked 516 Times in 235 Posts
Rep Power: 490
Brandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant future
Default

Nico,

Just curious, why do you want to print bar codes while Flexsim is running? Are you monitoring a real time system?

I think that others may want to do something similar and would be more interested in this post if they knew what you were trying to accomplish.

Thanks,
Brandon
__________________
thats not normal.

Last edited by Brandon Peterson; 04-14-2008 at 08:30 AM. Reason: update question
  #6  
Old 04-15-2008
Nico Zahn's Avatar
Nico Zahn Nico Zahn is offline
Flexsim User
 
Join Date: Sep 2007
Location: Bingen am Rhein, Germany
Posts: 179
Downloads: 19
Uploads: 4
Thanks: 66
Thanked 60 Times in 32 Posts
Rep Power: 201
Nico Zahn has a spectacular aura aboutNico Zahn has a spectacular aura about
Default

Hi Brandon,
we are thinking about it. It will be a system for developing and testing a real system, and the barcode is a interface to the erp system, which will be scanned mannually. Flexsim will be mostly used as an interface between some lpcs, the userinputs and another simulation. Of cause there will be some parts simulated in flexsim but we will have to integrate into a distributed enviorment.

So back to the printing: I got the cscript command working but I need to pass a string as part of the parameters in the runprogram command....??
__________________
kind regards Nico.
  #7  
Old 04-15-2008
Brandon Peterson's Avatar
Brandon Peterson Brandon Peterson is offline
The Flexsim Consultant
 
Join Date: Jul 2007
Location: Salt Lake City, Utah
Posts: 382
Downloads: 29
Uploads: 6
Thanks: 192
Thanked 516 Times in 235 Posts
Rep Power: 490
Brandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant future
Default

Nico,

Can you share the code that you are having problems with? I'm not sure what you mean by pass in a string.

Brandon
__________________
thats not normal.
  #8  
Old 04-17-2008
Nico Zahn's Avatar
Nico Zahn Nico Zahn is offline
Flexsim User
 
Join Date: Sep 2007
Location: Bingen am Rhein, Germany
Posts: 179
Downloads: 19
Uploads: 4
Thanks: 66
Thanked 60 Times in 32 Posts
Rep Power: 201
Nico Zahn has a spectacular aura aboutNico Zahn has a spectacular aura about
Default

Hi Brandon,
I have to pass something like this to the command shell:

cscript barcodeimage.wsf code128.bmp "text=Hello World" type=14 width=500 height=100
So one of the parameters is a string.

when I use the runprogram command it would look like this:

rundprgram("cscript C:\\pathtoapplication\\barcodeimage.wsf code128.bmp "text=Hello World" type=14 width=500 height=100");

So there are quotation marks inside the passed string..
__________________
kind regards Nico.
  #9  
Old 04-17-2008
Brandon Peterson's Avatar
Brandon Peterson Brandon Peterson is offline
The Flexsim Consultant
 
Join Date: Jul 2007
Location: Salt Lake City, Utah
Posts: 382
Downloads: 29
Uploads: 6
Thanks: 192
Thanked 516 Times in 235 Posts
Rep Power: 490
Brandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant future
Default

Nico,

Method 1 (C++):
In C++ the \ character and the " are special characters and you treat them the same when you want to include them in a string. Instead of having just the " try \" this should get the quote into your string. It is the same thing as having to have \\ when you only want \.
Code:
runprogram("cscript C:\\pathtoapplication\\barcodeimage.wsf code128.bmp \"text=Hello World\" type=14 width=500 height=100");

Method 2 (Flexscript):
In Flexscript this may be different and you can use the strquote() command. With this command you will want to place the string that you want in quotes withing the paranthesis.
Code:
runprogram(concat("cscript C:\\pathtoapplication\\barcodeimage.wsf code128.bmp ", strquote("text=Hello World"), " type=14 width=500 height=100"));

I'm not a C++ programmer by any means but I'm pretty sure I've got this right. I hope this makes sense to you.

Good Luck,
Brandon
__________________
thats not normal.

Last edited by Brandon Peterson; 04-17-2008 at 12:48 PM. Reason: Updated to include Flexscript and fix type



All times are GMT -6.
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.