Trust ID PBCEX logo 300x102

Conditional Track Encoding

4 years 1 week ago
Andrew York
Fresh Boarder
Fresh Boarder
Posts: 2
More
Topic Author
Conditional Track Encoding #6275
Is there a way to conditionally write data to a mag strip track?

For example, I'd rather this function turn off Track X instead of writing "Nothing"

def track1(MemberNo, Type):
if Type != "NC":
return MemberNo
else:
return None
4 years 5 days ago
Craig Bechelli
Administrator
Administrator
Posts: 624
More
Conditional Track Encoding #6277
Hi Andrew

Unfortunately Magnetic encoding is switched on or off and not easily controllable by a script, but you can switch magnetic encoding off and create a text object that contains the macro commands and data when needed.

The below example should do what you need:

def track1 (Type):
if Type != "NC":
return "~1%" + MemberNo + "?"
else:
return ""

Just link this to a text field on the card, you will need to change the macro commands depending on the printer model.

Hope that helps,
Craig

Craig Bechelli
CardExchange Solutions Support Team

"If you define the problem correctly, you almost have the solution." (Steve Jobs)
4 years 5 days ago
Andrew York
Fresh Boarder
Fresh Boarder
Posts: 2
More
Topic Author
Conditional Track Encoding #6278
Actually I just got this working.

I used my function. Added a "page 2" layout and put a mag stripe on page 2. I also made the page "not printable" and marked as "backside."

I did not have to put the stop and start escape codes in as they are part of the printer settings.

I use a Fargo 4500e. If there is mag data to put on the track then the printer will say "Encoding Magstripe" (or something like that) If the function returns "None" then the printer does not even attempt to encode the stripe.

We verified the results with our separate encoder.
×

Notice

The forum is in read only mode.