# Perspective: programmatically scan barcode

**URL:** <https://forum.inductiveautomation.com/t/perspective-programmatically-scan-barcode/90608>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [May 20, 2024, 9:39am UTC](https://forum.inductiveautomation.com/t/perspective-programmatically-scan-barcode/90608 "2024-05-20T09:39:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pgmo](https://avatars.discourse-cdn.com/v4/letter/p/d07c76/32.png) [@pgmo](https://forum.inductiveautomation.com/u/pgmo)\
**Post date:** [May 20, 2024, 9:39am UTC](https://forum.inductiveautomation.com/t/perspective-programmatically-scan-barcode/90608/1 "2024-05-20T09:39:28Z")

</div>

Hi all,  
is there any news about the possibility to scan a barcode programmatically from a Python piece of code, i.e. by issueing a `system.perspective.xxxxxx` command?  
Some time ago it seemd to be in the roadmap:

> [@How to use a QR code scanner from Camera in my Tablet and get those information to Ignition](https://forum.inductiveautomation.com/t/how-to-use-a-qr-code-scanner-from-camera-in-my-tablet-and-get-those-information-to-ignition/55384/4):
>
> Have those conditions control the enable/visibility of two separate buttons. As a work-around until IA creates that script function.

Thanks in advance, regards

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [May 20, 2024, 11:54am UTC](https://forum.inductiveautomation.com/t/perspective-programmatically-scan-barcode/90608/2 "2024-05-20T11:54:59Z")

</div>

No, just the action:

> **[Component Events and Actions | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/ignition-modules/perspective/working-with-perspective-components/component-events-and-actions#scan-barcode-action)**
>
> In Perspective, events and actions are some of the fundamental building blocks of project functionality. Actions give you the ability to respond to specific user inputs (such as mouse, keyboard, and touch inputs), as well as broad session events...

---

<div class="post-metadata">

**Author:** ![pgmo](https://avatars.discourse-cdn.com/v4/letter/p/d07c76/32.png) [@pgmo](https://forum.inductiveautomation.com/u/pgmo)\
**Post date:** [May 20, 2024, 11:59am UTC](https://forum.inductiveautomation.com/t/perspective-programmatically-scan-barcode/90608/3 "2024-05-20T11:59:49Z")

</div>

> [@pturmel](#):
>
> No, just the action

Thanks @pturmel .That's a problem in my case, because I need to trigger a scan depending on a tag ValueChanged event, where I've to decide if a scan is needed or not.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [May 20, 2024, 12:02pm UTC](https://forum.inductiveautomation.com/t/perspective-programmatically-scan-barcode/90608/4 "2024-05-20T12:02:02Z")

</div>

What if no session is open? Or user pointing at the barcode? (Seems very strange to drive such from a tag. Perhaps you need a standalone scanner connected to the gateway?)

---

<div class="post-metadata">

**Author:** ![pgmo](https://avatars.discourse-cdn.com/v4/letter/p/d07c76/32.png) [@pgmo](https://forum.inductiveautomation.com/u/pgmo)\
**Post date:** [May 20, 2024, 12:45pm UTC](https://forum.inductiveautomation.com/t/perspective-programmatically-scan-barcode/90608/5 "2024-05-20T12:45:57Z")

</div>

Hi @pturmel , you are right, a session must be open, that's not an option.
