5/31/2024 11:16 AM | |
Joined: 2/12/2011 Last visit: 6/3/2025 Posts: 115 Rating:
|
As we all know the Siemens debugger that we use to write the java script in lacks lots of features. There is no auto complete. No even a really good help that indicates if you spell something wrong. E.g. using big and small letters in the wrong way. If so when starting your code it just terminates without any reason. Enojng.... There are some helpful things that you can use to simplify the coding and debugging: 1) To test java scripts in general, this site is very good. You have to be registered but to write small snippets for test is free. I use this one: https://playcode.io/, I highly recommend it. Here you can also see how a modern development platform works. 2) From TIA19 it should be possible to use Visual studio for writing code to link it to the TIA portal. I did up to now not test this but that can also be a solution. You can read more abut this in this good post: Link to post covering this 3) Use the Chrome debug tool. This is Veeery helpful: This was what I made me to get it to work: * You can also look in the console by selecting this menu item. Next to the source item. consol.log("Hello world"); All this messages will be shown under the console. The good thing is that you can log whole arrays and whole objects. You will get into it fast. The Debug tool is very self explaining. One more thing. Do not make any change in the code in the code window if the debug tool. make changes in TIA and then restart the simulation again. After restart the simulation you must also start the debug tools as it looses connection when the HMI simulation is downloaded. Good luck with your coding. Just let me know if you have any questions. //Mattias Lindh |
Last edited by: Mr Lindh at: 05/31/2024 11:21:04Last edited by: Jen_Moderator at: 06/03/2024 06:02:01Link optimized. Mr Lindh, |
|
This contribution was helpful to
3 thankful Users |
Follow us on