Page 3 of 3 FirstFirst 123
Results 41 to 59 of 59

Topic: Direct CronusMAX Plus API

  1. #41
    Forum Admin

    User Info Menu

    Re: Direct CronusMAX Plus API

    Quote Originally Posted by hot955 View Post
    I have even managed to crash the API by sending commands (way) too fast (< 10ms). The API just stopped doing anything. Only when I unload everything and initialize the API again, then it worked again.
    That means i messed up the api somewhere, wish you would've told me this earlier so i could fix it =) (i can't fix bugs i don't know about )

  2. #42
    Fastest Thing Alive

    User Info Menu

    Re: Direct CronusMAX Plus API

    Quote Originally Posted by Swizzy View Post
    That means i messed up the api somewhere, wish you would've told me this earlier so i could fix it =) (i can't fix bugs i don't know about )
    Sorry! But I only ran into this just about a bit over a week ago. I was trying to read the controller and push the data to the PS4 as fast as possible, to see how much CPU it uses and how "slow" I can send it without creating any lag. It works with a Sleep of at least 10 ms. Anything lower starts to make the API unresponsive.

  3. #43
    My Other Ride Is a Yoshi

    User Info Menu

    Re: Direct CronusMAX Plus API

    Hello,

    New to the forum here and had a question or two about the WpfSample project in C#.

    I loaded everything up using Microsoft Visual Studio. The project bulids without error and works fine however, when double clicking on "MainWindow.xaml" the follow error occurs.

    Main Window: "Invalid Markup".
    XAML Window: Highlights LEDSelector "Value"
    Error List: "The member "Value" is not recognized or is not accessible.

    If I start deleting these I can get the MainWindow to load - but quickly run into other issues. Does anyone know how to solve this problem?


    Second: I was hoping to get a little help with something.

    What I'd like to do is create a loop (timing adjustable down to 10ms) that outputs all controller button presses, thumbstick movements, trigger pulls etc, to a text file with a timestamp of each. This would be fine if done after "Start I/O Requests" is clicked in the Device I/O Status screen. The text file could stop recording controller outputs when the "Stop I/O Requests" button is pressed.

    Any help would be greatly appreciated!

    Thank you.
    -Embalmer
    Attached Images Attached Images

  4. #44
    Forum Admin

    User Info Menu

    Re: Direct CronusMAX Plus API

    Quote Originally Posted by Embalmer View Post
    Hello,

    New to the forum here and had a question or two about the WpfSample project in C#.

    I loaded everything up using Microsoft Visual Studio. The project bulids without error and works fine however, when double clicking on "MainWindow.xaml" the follow error occurs.

    Main Window: "Invalid Markup".
    XAML Window: Highlights LEDSelector "Value"
    Error List: "The member "Value" is not recognized or is not accessible.

    If I start deleting these I can get the MainWindow to load - but quickly run into other issues. Does anyone know how to solve this problem?


    Second: I was hoping to get a little help with something.

    What I'd like to do is create a loop (timing adjustable down to 10ms) that outputs all controller button presses, thumbstick movements, trigger pulls etc, to a text file with a timestamp of each. This would be fine if done after "Start I/O Requests" is clicked in the Device I/O Status screen. The text file could stop recording controller outputs when the "Stop I/O Requests" button is pressed.

    Any help would be greatly appreciated!

    Thank you.
    -Embalmer
    That error should go away if you close the designer, compile the project then open the designer again, it's something i see all the time with WPF when a custom control is used which isn't part of another library and when a property on said control is being used like this case...

    The way to do what you ask for is to have a thread running that sends a RequestIOStatus command and having a eventhandler for the IOStatusChanged (this event has all the inputs/outputs in a object for you to use...

    You probably should stick to windowsforms if you're new to programming as WPF can be a bit tricky to handle at times

  5. The Following User Says Thank You to Swizzy For This Useful Post:


  6. #45
    My Other Ride Is a Yoshi

    User Info Menu

    Re: Direct CronusMAX Plus API

    Quote Originally Posted by Swizzy View Post
    That error should go away if you close the designer, compile the project then open the designer again, it's something i see all the time with WPF when a custom control is used which isn't part of another library and when a property on said control is being used like this case...

    The way to do what you ask for is to have a thread running that sends a RequestIOStatus command and having a eventhandler for the IOStatusChanged (this event has all the inputs/outputs in a object for you to use...

    You probably should stick to windowsforms if you're new to programming as WPF can be a bit tricky to handle at times
    Thanks for the reply Swizzy.

    Closing the designer, recompiling, and re-opening unfortunately is not working as you suggested. For your reference I'm using a fresh install of Visual Studio Community 2017 edition.

    I'm not new to coding but I am new to WPF. I'm figuring things out and I already have an output working - but it's rudimentary at best. It's outputting everything regardless of change - so I'll try using the IOStatusChanged as you suggested. Should be much better.

    Thanks for the help.
    -Embalmer

  7. #46
    Forum Admin

    User Info Menu

    Re: Direct CronusMAX Plus API

    Quote Originally Posted by Embalmer View Post
    Thanks for the reply Swizzy.

    Closing the designer, recompiling, and re-opening unfortunately is not working as you suggested. For your reference I'm using a fresh install of Visual Studio Community 2017 edition.

    I'm not new to coding but I am new to WPF. I'm figuring things out and I already have an output working - but it's rudimentary at best. It's outputting everything regardless of change - so I'll try using the IOStatusChanged as you suggested. Should be much better.

    Thanks for the help.
    -Embalmer
    IOStatusChanged doesn't tell you which buttons/sticks etc. Changed from previous state, it merely tells you that a new IORequest Response was recieved from the CM, i can probably implement a way to get separate events for each Input/Output if you would prefer it that way?

    I will look into the WPF Sample project and see if it's something i can make properly work with the designer in VS 2017, I've only used VS 2015 for this particular project...

  8. The Following User Says Thank You to Swizzy For This Useful Post:


  9. #47
    My Other Ride Is a Yoshi

    User Info Menu

    Re: Direct CronusMAX Plus API

    Quote Originally Posted by Swizzy View Post
    IOStatusChanged doesn't tell you which buttons/sticks etc. Changed from previous state, it merely tells you that a new IORequest Response was recieved from the CM, i can probably implement a way to get separate events for each Input/Output if you would prefer it that way?

    I will look into the WPF Sample project and see if it's something i can make properly work with the designer in VS 2017, I've only used VS 2015 for this particular project...
    Sounds great Swizzy!

    Currently the way I'm doing it is I have edited IoStatusDisplay.xaml.cs. After line 96 I added a series of checks to see if In00.Value != status.InputStatus.Input00 and so on. It works for the most part however, I'm seeing a bit of a problem with getting accurate thumb stick press data. I believe I'm "missing" the press or release at times possibly because of the loop timing or because there is other thumb stick traffic. Not sure what's going on there. If you have some better thoughts on how to do it that would be great!

    And yes, possibly there's some differences in VS 2017 that are causing the issue with the designer.

    Appreciate all the help Swizzy!

    -Embalmer

  10. #48
    My Other Ride Is a Yoshi

    User Info Menu

    Re: Direct CronusMAX Plus API

    Actually I found the issue with my thumbstick presses... it was due to how I was writing the strings. Thanks again

    -Embalmer

  11. The Following User Says Thank You to Embalmer For This Useful Post:


  12. #49
    My Other Ride Is a Yoshi

    User Info Menu

    Re: Direct CronusMAX Plus API

    Quote Originally Posted by Swizzy View Post
    IOStatusChanged doesn't tell you which buttons/sticks etc. Changed from previous state, it merely tells you that a new IORequest Response was recieved from the CM, i can probably implement a way to get separate events for each Input/Output if you would prefer it that way?

    I will look into the WPF Sample project and see if it's something i can make properly work with the designer in VS 2017, I've only used VS 2015 for this particular project...
    Swizzy,

    Oddly enough the designer just started working. I didn't do anything different - one day it just started working. Strange.

    On to my next topics:

    1) If I wanted to connect several Cronus devices to the same APP (WpfSample for example), what would be the best way to do that? Currently I have to run several instances of the application to connect multiple devices but would prefer to do that in one application.

    2) Is there a way to pull the serial number or device ID info off of the cronus? Since I want to plug in several cronus devices at once, I'd like a way to identify which is which easily.

    Any help is greatly appreciated!

    Thanks again!
    -Embalmer

  13. #50
    Forum Admin

    User Info Menu

    Re: Direct CronusMAX Plus API

    The current API was only designed for single device communication...

    The current API does not translate the Serial at this time, i did write another version of the API that is much better (can handle multiple CM's simultaneously and can do almost everything you can do with CronusPRO, pretty much everything except for programming the firmware/slots) however, i am not allowed to share it at this time :/

  14. #51
    Babyfaced Assassin

    User Info Menu

    Re: Direct CronusMAX Plus API

    When will the next API be available Swizzy?

  15. #52
    Forum Admin

    User Info Menu

    Re: Direct CronusMAX Plus API

    Quote Originally Posted by stickweed View Post
    When will the next API be available Swizzy?
    When i'm given ideas of what's missing, the alternative edition i wrote isn't mine to share, it's private for the people i wrote it for...

    It'll probably take some time before any further updates can be released

  16. #53
    Forum Admin

    User Info Menu

    Re: Direct CronusMAX Plus API

    I've made a minor update attached to this post, basically the new version has protection against potential deadlocks caused by the events, this is something that was requested by Embalmer recently after he experienced a freeze at one point (communicated to me via PM)

    The new version is also signed and has xml documentation
    Attached Files Attached Files

  17. #54
    Babyfaced Assassin

    User Info Menu

    Re: Direct CronusMAX Plus API

    Hello bros,

    I have a problem with run list step press button.

    Anyone have example code in WPF or C# please help me.

    Thanks a lot.

  18. #55
    Forum Admin

    User Info Menu

    Re: Direct CronusMAX Plus API

    Quote Originally Posted by RongK9 View Post
    Hello bros,

    I have a problem with run list step press button.

    Anyone have example code in WPF or C# please help me.

    Thanks a lot.
    Can you explain what it is you need in more detail?

  19. #56
    Babyfaced Assassin

    User Info Menu

    Re: Direct CronusMAX Plus API

    I trying to press button step by step like

    Left -> Up -> right -> Down ...

    But sometime the button doesn't press.

    I use the interval is 0.1s

  20. #57
    Forum Admin

    User Info Menu

    Re: Direct CronusMAX Plus API

    Can you show the code you've used to try and do this that isn't working?

  21. #58
    Babyfaced Assassin

    User Info Menu


  22. #59
    Forum Admin

    User Info Menu

    Re: Direct CronusMAX Plus API

    First thing i notice, you're running it ever 10 100's of a NANO seconds, not 0.1s like you think, use this: TimeSpan.FromMilliseconds(10); instead of new TimeSpan(10);

    For reference: https://msdn.microsoft.com/en-us/lib...v=vs.110).aspx (what you use) https://msdn.microsoft.com/en-us/lib...v=vs.110).aspx (what i recommend using), keep in mind that this will only hold the buttons for 10ms as you're sending a empty buffer if there is no command, you do probably want to have the timer run on a 40ms interval to mimic what we usually do for rapidfire mods

Page 3 of 3 FirstFirst 123

Similar Topics

  1. Issues with direct input
    By PaRappa in forum CronusMAX PLUS Keyboard & Mouse Support
    Replies: 8
    Last Post: 25th April 16, 14:00
  2. [PS4] Question about Direct Input
    By HaD3z in forum CronusMAX PLUS Hardware Support
    Replies: 2
    Last Post: 14th March 16, 04:27
  3. Direct Input 360 Axis Fix
    By ChicKeN in forum CronusMAX PLUS Hardware Support
    Replies: 0
    Last Post: 11th November 14, 17:43
  4. Direct API Template
    By Nefylem in forum Cronus PRO Software Support
    Replies: 3
    Last Post: 14th April 14, 19:37
  5. Direct Input Option?
    By W.A.C. in forum Cronus PRO Software Support
    Replies: 5
    Last Post: 27th March 14, 22:20

Posting Permissions

  • You may not post new topics
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •