Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
2
Question by hadarl · Dec 30, 2016 at 01:37 PM · triggerssynchronizationtimingparallel port

communicating with parallel port

Hello

We're using unity for psychophysical experiments and we need to know an exact timing of things occurring in the game. The preferred solution is to communicate with an LPT port connected to the experimental equipment and send a message every time a specific event occurs in the game or a key is pressed. My question is whether it is possible to send these triggers to the parallel port from within Unity?
Since this will be used to synchronize between the Unity and the data (EEG) collected from the subject, we need to make sure that these messages to the LPT are really sent with a precise timing. We can tolerate a delay in the trigger sending if it is a constant delay, but the noise in this delay shouldn't be much more than ~30 milliseconds.

This questions was actually already asked in the past @Agoston Torok, @Bunny83, @aldonaletto, but it was 5 years ago and I understand these features in Unity changed meanwhile. See the post here: http://answers.unity3d.com/questions/134463/communicate-with-parallel-port.html

Thanks for any help!

Hadar

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image jmous · Feb 22, 2017 at 06:09 PM 0
Share

Dear Hadar, I am more or less in the same situation and i was wondering if you can share any help/advice or code.

Best Regards. Yannis

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Socapex · Dec 30, 2016 at 07:35 PM

You will want to use C# features for that, it seems very easy. Here is a tutorial and here is another code example. You will basically dllimport the correct library and work with that. It is trivial.

If latency is an issue, than you can make a C dll and use sockets (I imagine, never done LTP per say). Note that native dlls are now part of unity free. I'd stick to C# for the first prototype.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by tony_torok · Jan 03, 2017 at 01:49 PM

Dear Hadar,

@Socapex is right, you'll need to communicate with the port using a c# script and inpout32.dll or similar (depending on your OS). From the latency point of view: we used a light diode to check for sync in our setup (attached it to the screen and check the latency between trigger and diode signal), I suggest you to do the same. Note that FPS may change during a game, your screen has a refresh rate too, and the physics in the game is not tied to refresh rate. Also, note that delay is not much of a problem, uncertainty on the other hand is. If you have other questions pls don't hesitate to contact torok.agoston@ttk.mta.hu

Regards,

Tony

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Link0n3 · May 31, 2018 at 05:15 PM

Has been there any improvement in this? I am trying to have the inpout32 working in Unity 2017 but no luck so far.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

8 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How do I get triggers to work at a pixel perfect level? 0 Answers

Communicate with parallel port 4 Answers

how to keep texture animations in sync 0 Answers

Photon synchronization 1 Answer

How to sync material change at runtime - unet ? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges